From: Andrew Lewis Date: Sun, 11 Jun 2017 17:48:57 +0000 (+0200) Subject: [Conf] Do away with systemd specifics completely X-Git-Tag: 1.6.0~17^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=17a6ce2ae11994e60f88e934edf2f62ce799089c;p=rspamd.git [Conf] Do away with systemd specifics completely --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d851fd38..26f16a8a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1294,21 +1294,12 @@ FOREACH(CONF_FILE ${CONF_FILES}) DESTINATION ${CONFDIR}/${_rp}) ENDFOREACH(CONF_FILE) -# Main config is special due to systemd -IF(WANT_SYSTEMD_UNITS MATCHES "ON") - SET(MAIN_CONF "conf/rspamd.systemd.conf") -ELSE(WANT_SYSTEMD_UNITS MATCHES "ON") - SET(MAIN_CONF "conf/rspamd.sysvinit.conf") -ENDIF(WANT_SYSTEMD_UNITS MATCHES "ON") +SET(MAIN_CONF "conf/rspamd.conf") IF(BUILD_PORT) INSTALL_IF_NOT_EXISTS(${MAIN_CONF} ${CONFDIR} "rspamd.conf" ".sample") ELSE(BUILD_PORT) INSTALL_IF_NOT_EXISTS(${MAIN_CONF} ${CONFDIR} "rspamd.conf" "") ENDIF(BUILD_PORT) -# Debian is also special -IF(DEBIAN_BUILD) - INSTALL_IF_NOT_EXISTS("conf/rspamd.sysvinit.conf" ${CONFDIR} "rspamd.sysvinit.conf" "") -ENDIF(DEBIAN_BUILD) IF(INSTALL_EXAMPLES MATCHES "ON") INSTALL(FILES ${MAIN_CONF} DESTINATION ${EXAMPLESDIR}) ENDIF(INSTALL_EXAMPLES MATCHES "ON") diff --git a/centos/rspamd.spec b/centos/rspamd.spec index 7cadb4f42..0e7819c0b 100644 --- a/centos/rspamd.spec +++ b/centos/rspamd.spec @@ -48,14 +48,14 @@ BuildRequires: luajit-devel %else BuildRequires: lua-devel %endif -%if 0%{?el6} Requires: logrotate +%if 0%{?el6} Requires(post): chkconfig Requires(preun): chkconfig, initscripts Requires(postun): initscripts Source1: %{name}.init -Source2: %{name}.logrotate %endif +Source2: %{name}.logrotate Source0: https://rspamd.com/downloads/%{name}-%{version}.tar.xz Source3: 80-rspamd.preset @@ -110,9 +110,9 @@ lua. %if 0%{?el6} %{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name} %{__install} -d -p -m 0755 %{buildroot}%{_localstatedir}/run/rspamd +%endif %{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir} -%endif %{__install} -d -p -m 0755 %{buildroot}%{rspamd_home} %{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/local.d/ @@ -181,9 +181,9 @@ fi %if 0%{?el6} %{_initrddir}/%{name} %dir %{_localstatedir}/run/rspamd +%endif %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %dir %{rspamd_logdir} -%endif %{_mandir}/man8/%{name}.* %{_mandir}/man1/rspamc.* %{_mandir}/man1/rspamadm.* @@ -192,7 +192,6 @@ fi %{_bindir}/rspamc %{_bindir}/rspamadm %config(noreplace) %{rspamd_confdir}/%{name}.conf -%config(noreplace) %{rspamd_confdir}/%{name}.sysvinit.conf %config(noreplace) %{rspamd_confdir}/composites.conf %config(noreplace) %{rspamd_confdir}/metrics.conf %config(noreplace) %{rspamd_confdir}/mime_types.inc @@ -206,7 +205,6 @@ fi %config(noreplace) %{rspamd_confdir}/worker-fuzzy.inc %config(noreplace) %{rspamd_confdir}/worker-normal.inc %config(noreplace) %{rspamd_confdir}/modules.d/* -%config(noreplace) %{rspamd_confdir}/rspamd.systemd.conf %attr(-, _rspamd, _rspamd) %dir %{rspamd_home} %dir %{rspamd_rulesdir}/regexp %dir %{rspamd_rulesdir} diff --git a/centos/sources/rspamd.init b/centos/sources/rspamd.init index ee3365b31..67bfa15ff 100644 --- a/centos/sources/rspamd.init +++ b/centos/sources/rspamd.init @@ -14,7 +14,7 @@ # chkconfig: - 85 15 # description: rspamd is a spam filtering system # processname: rspamd -# config: /etc/rspamd/rspamd.sysvinit.conf +# config: /etc/rspamd/rspamd.conf # config: /etc/sysconfig/rspamd # pidfile: /var/run/rspamd/rspamd.pid @@ -31,7 +31,7 @@ rspamd="/usr/bin/rspamd" rspamadm="/usr/bin/rspamadm" prog=$(basename $rspamd) -RSPAMD_CONF_FILE="/etc/rspamd/rspamd.sysvinit.conf" +RSPAMD_CONF_FILE="/etc/rspamd/rspamd.conf" RSPAMD_USER="_rspamd" RSPAMD_GROUP="_rspamd" diff --git a/conf/rspamd.conf b/conf/rspamd.conf new file mode 100644 index 000000000..c8d308658 --- /dev/null +++ b/conf/rspamd.conf @@ -0,0 +1,63 @@ +# System V init adopted top level configuration + +# Please don't modify this file as your changes might be overwritten with +# the next update. +# +# You can modify '$LOCAL_CONFDIR/rspamd.conf.local.override' to redefine +# parameters defined on the top level +# +# You can modify '$LOCAL_CONFDIR/rspamd.conf.local' to add +# parameters defined on the top level +# +# For specific modules or configuration you can also modify +# '$LOCAL_CONFDIR/local.d/file.conf' - to add your options or rewrite defaults +# '$LOCAL_CONFDIR/override.d/file.conf' - to override the defaults +# +# See https://rspamd.com/doc/tutorials/writing_rules.html for details + +.include "$CONFDIR/common.conf" + +options { + pidfile = "$RUNDIR/rspamd.pid"; + .include "$CONFDIR/options.inc" + .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/options.inc" + .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/options.inc" +} + +logging { + type = "file"; + filename = "$LOGDIR/rspamd.log"; + .include "$CONFDIR/logging.inc" + .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/logging.inc" + .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/logging.inc" +} + +worker { + bind_socket = "*:11333"; + .include "$CONFDIR/worker-normal.inc" + .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-normal.inc" + .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-normal.inc" +} + +worker { + bind_socket = "localhost:11334"; + .include "$CONFDIR/worker-controller.inc" + .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-controller.inc" + .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-controller.inc" +} + +worker "rspamd_proxy" { + bind_socket = "*:11332"; + .include "$CONFDIR/worker-proxy.inc" + .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-proxy.inc" + .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-proxy.inc" +} + +# Local fuzzy storage is disabled by default + +#worker { +# bind_socket = "*:11335"; +# .include "$CONFDIR/worker-fuzzy.inc" +# .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-fuzzy.inc" +# .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-fuzzy.inc" +#} diff --git a/conf/rspamd.systemd.conf b/conf/rspamd.systemd.conf deleted file mode 100644 index dd9bbcb7c..000000000 --- a/conf/rspamd.systemd.conf +++ /dev/null @@ -1,53 +0,0 @@ -# Systemd enabled top level configuration file - -# Please don't modify this file as your changes might be overwritten with -# the next update. -# -# You can modify '$LOCAL_CONFDIR/rspamd.conf.local.override' to redefine -# parameters defined on the top level -# -# You can modify '$LOCAL_CONFDIR/rspamd.conf.local' to add -# parameters defined on the top level -# -# For specific modules or configuration you can also modify -# '$LOCAL_CONFDIR/local.d/file.conf' - to add your options or rewrite defaults -# '$LOCAL_CONFDIR/override.d/file.conf' - to override the defaults -# -# See https://rspamd.com/doc/tutorials/writing_rules.html for details - -.include "$CONFDIR/common.conf" - -options { - .include "$CONFDIR/options.inc" - .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/options.inc" - .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/options.inc" -} - -logging { - type = "console"; - systemd = true; - .include "$CONFDIR/logging.inc" - .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/logging.inc" - .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/logging.inc" -} - -worker "normal" { - bind_socket = "*:11333"; - .include "$CONFDIR/worker-normal.inc" - .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-normal.inc" - .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-normal.inc" -} - -worker "controller" { - bind_socket = "localhost:11334"; - .include "$CONFDIR/worker-controller.inc" - .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-controller.inc" - .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-controller.inc" -} - -worker "rspamd_proxy" { - bind_socket = "*:11332"; - .include "$CONFDIR/worker-proxy.inc" - .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-proxy.inc" - .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-proxy.inc" -} \ No newline at end of file diff --git a/conf/rspamd.sysvinit.conf b/conf/rspamd.sysvinit.conf deleted file mode 100644 index c8d308658..000000000 --- a/conf/rspamd.sysvinit.conf +++ /dev/null @@ -1,63 +0,0 @@ -# System V init adopted top level configuration - -# Please don't modify this file as your changes might be overwritten with -# the next update. -# -# You can modify '$LOCAL_CONFDIR/rspamd.conf.local.override' to redefine -# parameters defined on the top level -# -# You can modify '$LOCAL_CONFDIR/rspamd.conf.local' to add -# parameters defined on the top level -# -# For specific modules or configuration you can also modify -# '$LOCAL_CONFDIR/local.d/file.conf' - to add your options or rewrite defaults -# '$LOCAL_CONFDIR/override.d/file.conf' - to override the defaults -# -# See https://rspamd.com/doc/tutorials/writing_rules.html for details - -.include "$CONFDIR/common.conf" - -options { - pidfile = "$RUNDIR/rspamd.pid"; - .include "$CONFDIR/options.inc" - .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/options.inc" - .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/options.inc" -} - -logging { - type = "file"; - filename = "$LOGDIR/rspamd.log"; - .include "$CONFDIR/logging.inc" - .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/logging.inc" - .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/logging.inc" -} - -worker { - bind_socket = "*:11333"; - .include "$CONFDIR/worker-normal.inc" - .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-normal.inc" - .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-normal.inc" -} - -worker { - bind_socket = "localhost:11334"; - .include "$CONFDIR/worker-controller.inc" - .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-controller.inc" - .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-controller.inc" -} - -worker "rspamd_proxy" { - bind_socket = "*:11332"; - .include "$CONFDIR/worker-proxy.inc" - .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-proxy.inc" - .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-proxy.inc" -} - -# Local fuzzy storage is disabled by default - -#worker { -# bind_socket = "*:11335"; -# .include "$CONFDIR/worker-fuzzy.inc" -# .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-fuzzy.inc" -# .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-fuzzy.inc" -#} diff --git a/debian/rspamd.init b/debian/rspamd.init index 1a270692e..0cde6447a 100644 --- a/debian/rspamd.init +++ b/debian/rspamd.init @@ -17,7 +17,7 @@ DESC="Rspamd" NAME=rspamd DAEMON=/usr/bin/$NAME RSPAMADM=/usr/bin/rspamadm -DAEMON_ARGS="-c /etc/rspamd/rspamd.sysvinit.conf" +DAEMON_ARGS="-c /etc/rspamd/rspamd.conf" DESC="rapid spam filtering system" PIDFILE=/run/rspamd/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME