]> source.dussan.org Git - rspamd.git/commitdiff
[Conf] Do away with systemd specifics completely 1675/head
authorAndrew Lewis <nerf@judo.za.org>
Sun, 11 Jun 2017 17:48:57 +0000 (19:48 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Sun, 11 Jun 2017 17:48:57 +0000 (19:48 +0200)
CMakeLists.txt
centos/rspamd.spec
centos/sources/rspamd.init
conf/rspamd.conf [new file with mode: 0644]
conf/rspamd.systemd.conf [deleted file]
conf/rspamd.sysvinit.conf [deleted file]
debian/rspamd.init

index 7d851fd38c249ccffa1599080558399bb6267803..26f16a8a5c658111addf75dc458bba09436984af 100644 (file)
@@ -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")
index 7cadb4f42275d004fbfa20792924cbe4b48d6230..0e7819c0b3612d3571457999873c56f08e61eb75 100644 (file)
@@ -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}
index ee3365b3121ad0c207316f2150b1c1e3ffca9073..67bfa15ff7757b5c75904a384aaee8885c986cff 100644 (file)
@@ -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 (file)
index 0000000..c8d3086
--- /dev/null
@@ -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 (file)
index dd9bbcb..0000000
+++ /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 (file)
index c8d3086..0000000
+++ /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"
-#}
index 1a270692e74a32ce6fa2ff77dff5e5b4ac0067c5..0cde6447aeaf39bfb868f10770e80068d4d780e7 100644 (file)
@@ -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