SET(INCLUDEDIR include/rspamd)
ENDIF(NOT INCLUDEDIR)
+IF(NOT SYSTEMDDIR)
+ SET(SYSTEMDDIR ${CMAKE_INSTALL_PREFIX}/lib/systemd/system)
+ENDIF(NOT SYSTEMDDIR)
+
############################# INCLUDE SECTION #############################################
INCLUDE(CheckIncludeFiles)
INSTALL(FILES "conf/lua/${LUA_CONF}" DESTINATION ${CONFDIR}/lua/${_rp})
ENDFOREACH(LUA_CONF)
+# systemd unit
+
+INSTALL(FILES "rspamd.service" DESTINATION ${SYSTEMDDIR})
+INSTALL(FILES "rspamd.socket" DESTINATION ${SYSTEMDDIR})
+
# Manual pages
INSTALL(FILES "doc/rspamd.8" DESTINATION ${MANDIR}/man8)
INSTALL(FILES "doc/rspamc.1" DESTINATION ${MANDIR}/man1)
Section: mail
Priority: optional
Maintainer: Mikhail Gusarov <dottedmag@debian.org>
-Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), cmake, libevent-dev (>= 1.3), libglib2.0-dev (>= 2.16.0), libgmime-2.6-dev, liblua5.2-dev | liblua5.1-dev | liblua5.1-0-dev, libpcre3-dev, libssl-dev (>= 1.0), libcurl4-openssl-dev, libhiredis-dev
+Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), cmake, libevent-dev (>= 1.3), libglib2.0-dev (>= 2.16.0), libgmime-2.6-dev, liblua5.2-dev | liblua5.1-dev | liblua5.1-0-dev, libpcre3-dev, libssl-dev (>= 1.0), libcurl4-openssl-dev, libhiredis-dev, dh-systemd
Standards-Version: 3.9.5
Homepage: https://rspamd.com
Vcs-Git: git://github.com/vstakhov/rspamd.git
--- /dev/null
+logging {
+ type = "console";
+ level = "info";
+}
--- /dev/null
+debian/workers.conf etc/rspamd
+debian/logging.conf etc/rspamd
#!/usr/bin/make -f
%:
- dh $@
+ dh $@ --with systemd
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
# Until https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739834 is fixed
override_dh_fixperms:
dh_fixperms
chmod 750 $(CURDIR)/debian/rspamd/var/lib/rspamd
+
+override_dh_systemd_start:
+ dh_systemd_start --restart-after-upgrade
--- /dev/null
+worker {
+ type = "normal";
+ bind_socket = "systemd:0";
+ http = false;
+ allow_learn = true;
+ mime = true;
+}
+worker {
+ type = "controller";
+ bind_socket = "systemd:1";
+ count = 1;
+}
+worker {
+ type = "webui";
+ count = 1;
+ bind_socket = "systemd:2";
+ password = "q1";
+ secure_ip = "127.0.0.1";
+}
--- /dev/null
+[Unit]
+Description=rapid spam filtering system
+
+[Service]
+Type=simple
+# Replace Pre/Post with RuntimeDirectory once it is available
+PermissionsStartOnly=true
+ExecStartPre=/bin/mkdir -m700 -p /run/rspamd
+ExecStartPre=/bin/chown _rspamd:_rspamd /run/rspamd
+ExecStart=/usr/bin/rspamd -f -c /etc/rspamd/rspamd.conf
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStopPost=/bin/rm -r /run/rspamd
+WorkingDirectory=/var/lib/rspamd
+User=_rspamd
--- /dev/null
+[Unit]
+Description=rapid spam filtering system
+
+[Socket]
+ListenStream=11333
+ListenStream=127.0.0.1:11334
+ListenStream=127.0.0.1:11336
+FreeBind=true
+
+[Install]
+WantedBy=sockets.target