aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-17 21:57:23 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-17 21:57:23 +0000
commitcc544380dd8034bdedbb51211a96cd6119546f7d (patch)
tree523ad30eb762d16035590a78f53f098d46c89532
parenta261edfcd621ffc5e310e49c6e8aef2502ab434d (diff)
parent63b38d572fd0bc2fe57daeaa51a03a5ef4c83fad (diff)
downloadrspamd-cc544380dd8034bdedbb51211a96cd6119546f7d.tar.gz
rspamd-cc544380dd8034bdedbb51211a96cd6119546f7d.zip
Merge pull request #225 from fatalbanana/master
Try include rspamd.conf.local.override with high priority
-rw-r--r--CMakeLists.txt14
-rw-r--r--conf/common.conf (renamed from conf/rspamd.conf)6
-rw-r--r--conf/logging.conf7
-rw-r--r--conf/logging.inc3
-rw-r--r--conf/options.conf18
-rw-r--r--conf/options.inc16
-rw-r--r--conf/rspamd.sysvinit.conf22
-rw-r--r--conf/worker-controller.inc7
-rw-r--r--conf/worker-normal.inc4
-rw-r--r--conf/workers.conf15
-rw-r--r--debian/control4
-rw-r--r--debian/logging.conf4
-rw-r--r--debian/postinst9
-rw-r--r--debian/postrm8
-rw-r--r--debian/prerm8
-rw-r--r--debian/rspamd.maintscript3
-rwxr-xr-xdebian/rules8
-rw-r--r--debian/workers.conf13
18 files changed, 100 insertions, 69 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25df1a574..070f418d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,6 +21,9 @@ IF(NOT RSPAMD_USER)
SET(RSPAMD_GROUP "nobody")
ENDIF(NOT RSPAMD_USER)
+# Default for SysV Init
+SET(RSPAMD_WORKER_NORMAL "*:11333")
+SET(RSPAMD_WORKER_CONTROLLER "*:11334")
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
SET_PROPERTY(GLOBAL PROPERTY ALLOW_DUPLICATE_CUSTOM_TARGETS 1)
@@ -1013,16 +1016,17 @@ CONFIGURE_FILE(config.h.in src/config.h)
CONFIGURE_FILE(contrib/exim/local_scan.c.in contrib/exim/local_scan_rspamd.c @ONLY)
SET(CONFFILES
+ conf/common.conf
conf/composites.conf
- conf/logging.conf
conf/metrics.conf
conf/modules.conf
- conf/options.conf
- conf/rspamd.conf
conf/statistic.conf
- conf/workers.conf
conf/2tld.inc
- conf/surbl-whitelist.inc)
+ conf/logging.inc
+ conf/options.inc
+ conf/surbl-whitelist.inc
+ conf/worker-controller.inc
+ conf/worker-normal.inc)
##################### INSTALLATION ##########################################
diff --git a/conf/rspamd.conf b/conf/common.conf
index 3330f01d9..7155eddfc 100644
--- a/conf/rspamd.conf
+++ b/conf/common.conf
@@ -2,10 +2,7 @@
lua = "$CONFDIR/lua/rspamd.lua"
-.include "$CONFDIR/options.conf"
-.include "$CONFDIR/logging.conf"
.include "$CONFDIR/metrics.conf"
-.include "$CONFDIR/workers.conf"
.include "$CONFDIR/composites.conf"
.include "$CONFDIR/statistic.conf"
@@ -13,7 +10,8 @@ lua = "$CONFDIR/lua/rspamd.lua"
.include "$CONFDIR/modules.conf"
# User local settings
-.try_include "$CONFDIR/rspamd.conf.local"
+.include(try=true) "$CONFDIR/rspamd.conf.local"
+.include(try=true,priority=10) "$CONFDIR/rspamd.conf.local.override"
modules {
path = "$PLUGINSDIR/lua/"
diff --git a/conf/logging.conf b/conf/logging.conf
deleted file mode 100644
index 816582d56..000000000
--- a/conf/logging.conf
+++ /dev/null
@@ -1,7 +0,0 @@
-# Logging setup
-
-logging {
- level = "info";
- type = "file";
- filename = "$LOGDIR/rspamd.log";
-}
diff --git a/conf/logging.inc b/conf/logging.inc
new file mode 100644
index 000000000..bded3744b
--- /dev/null
+++ b/conf/logging.inc
@@ -0,0 +1,3 @@
+# Included from top-level .conf file
+
+level = "info";
diff --git a/conf/options.conf b/conf/options.conf
deleted file mode 100644
index 3565673e5..000000000
--- a/conf/options.conf
+++ /dev/null
@@ -1,18 +0,0 @@
-# Basic options
-
-options {
- pidfile = "$RUNDIR/rspamd.pid";
- filters = "chartable,dkim,spf,surbl,regexp,fuzzy_check";
- raw_mode = false;
- one_shot = false;
- cache_file = "$DBDIR/symbols.cache";
- map_watch_interval = 1min;
- dynamic_conf = "$DBDIR/rspamd_dynamic";
- history_file = "$DBDIR/rspamd.history";
- check_all_filters = false;
- dns {
- timeout = 1s;
- sockets = 16;
- retransmits = 5;
- }
-}
diff --git a/conf/options.inc b/conf/options.inc
new file mode 100644
index 000000000..85a69dca1
--- /dev/null
+++ b/conf/options.inc
@@ -0,0 +1,16 @@
+# Included from top-level .conf file
+
+filters = "chartable,dkim,spf,surbl,regexp,fuzzy_check";
+raw_mode = false;
+one_shot = false;
+cache_file = "$DBDIR/symbols.cache";
+map_watch_interval = 1min;
+dynamic_conf = "$DBDIR/rspamd_dynamic";
+history_file = "$DBDIR/rspamd.history";
+check_all_filters = false;
+dns {
+ timeout = 1s;
+ sockets = 16;
+ retransmits = 5;
+}
+tempdir = "/tmp";
diff --git a/conf/rspamd.sysvinit.conf b/conf/rspamd.sysvinit.conf
new file mode 100644
index 000000000..a7a0b4904
--- /dev/null
+++ b/conf/rspamd.sysvinit.conf
@@ -0,0 +1,22 @@
+.include "$CONFDIR/common.conf"
+
+options {
+ pidfile = "$RUNDIR/rspamd.pid";
+ .include "$CONFDIR/options.inc"
+}
+
+logging {
+ type = "file";
+ filename = "$LOGDIR/rspamd.log";
+ .include "$CONFDIR/logging.inc"
+}
+
+worker {
+ bind_socket = "*:11333";
+ .include "$CONFDIR/worker-normal.inc"
+}
+
+worker {
+ bind_socket = "localhost:11334";
+ .include "$CONFDIR/worker-controller.inc"
+}
diff --git a/conf/worker-controller.inc b/conf/worker-controller.inc
new file mode 100644
index 000000000..f0fe955f0
--- /dev/null
+++ b/conf/worker-controller.inc
@@ -0,0 +1,7 @@
+# Included from top-level .conf file
+
+type = "controller";
+count = 1;
+password = "q1";
+secure_ip = "127.0.0.1";
+static_dir = "${WWWDIR}";
diff --git a/conf/worker-normal.inc b/conf/worker-normal.inc
new file mode 100644
index 000000000..5f86dcc05
--- /dev/null
+++ b/conf/worker-normal.inc
@@ -0,0 +1,4 @@
+# Included from top-level .conf file
+
+type = "normal";
+mime = true;
diff --git a/conf/workers.conf b/conf/workers.conf
deleted file mode 100644
index 681d71058..000000000
--- a/conf/workers.conf
+++ /dev/null
@@ -1,15 +0,0 @@
-# Common workers configuration
-
-worker {
- type = "normal";
- bind_socket = "*:11333";
- mime = true;
-}
-worker {
- type = "controller";
- count = 1;
- bind_socket = "localhost:11334";
- password = "q1";
- secure_ip = "127.0.0.1";
- static_dir = "${WWWDIR}";
-}
diff --git a/debian/control b/debian/control
index f15edbc92..f3011d4b0 100644
--- a/debian/control
+++ b/debian/control
@@ -2,8 +2,8 @@ Source: rspamd
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, libsqlite3-dev, perl, dh-systemd
-Standards-Version: 3.9.5
+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.1-dev | liblua5.1-0-dev, libluajit-5.1-dev, libpcre3-dev, libssl-dev (>= 1.0), libcurl4-openssl-dev, libhiredis-dev, libsqlite3-dev, perl, dh-systemd
+Standards-Version: 3.9.6
Homepage: https://rspamd.com
Vcs-Git: git://github.com/vstakhov/rspamd.git
Vcs-Browser: https://github.com/vstakhov/rspamd
diff --git a/debian/logging.conf b/debian/logging.conf
deleted file mode 100644
index 33234fde1..000000000
--- a/debian/logging.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-logging {
- type = "console";
- level = "info";
-}
diff --git a/debian/postinst b/debian/postinst
index 7d6db2347..6d725a90d 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -29,6 +29,15 @@ case "$1" in
;;
esac
+if [ -x /etc/init.d/rspamd ]; then
+ update-rc.d rspamd defaults >/dev/null
+ if [ -d /run/systemd/systemd ]; then
+ systemctl --system daemon-reload >/dev/null || true
+ else
+ invoke-rc.d rspamd start || exit $?
+ fi
+fi
+
#DEBHELPER#
exit 0
diff --git a/debian/postrm b/debian/postrm
index 10a84805e..0ab952d46 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -1,6 +1,14 @@
#!/bin/sh
set -e
+if [ "$1" = "purge" ]; then
+ update-rc.d rspamd remove >/dev/null
+fi
+
+if [ -d /run/systemd/system ]; then
+ systemctl --system daemon-reload >/dev/null || true
+fi
+
#DEBHELPER#
case "$1" in
diff --git a/debian/prerm b/debian/prerm
new file mode 100644
index 000000000..94172155b
--- /dev/null
+++ b/debian/prerm
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+
+if [ -x /etc/init.d/rspamd ] && ! [ -d /run/systemd/system ]; then
+ invoke-rc.d rspamd stop || exit $?
+fi
+
+#DEBHELPER#
diff --git a/debian/rspamd.maintscript b/debian/rspamd.maintscript
new file mode 100644
index 000000000..62cb0bd92
--- /dev/null
+++ b/debian/rspamd.maintscript
@@ -0,0 +1,3 @@
+rm_conffile /etc/rspamd/logging.conf 0.6.11~ rspamd
+rm_conffile /etc/rspamd/options.conf 0.6.11~ rspamd
+rm_conffile /etc/rspamd/workers.conf 0.6.11~ rspamd
diff --git a/debian/rules b/debian/rules
index 9eb1014f1..e3959eb57 100755
--- a/debian/rules
+++ b/debian/rules
@@ -32,5 +32,11 @@ override_dh_fixperms:
dh_fixperms
chmod 750 $(CURDIR)/debian/rspamd/var/lib/rspamd
+override_dh_systemd_enable:
+ dh_systemd_enable rspamd.socket
+
override_dh_systemd_start:
- dh_systemd_start --restart-after-upgrade
+ dh_systemd_start --restart-after-upgrade --no-start
+
+override_dh_installinit:
+ dh_installinit -n
diff --git a/debian/workers.conf b/debian/workers.conf
deleted file mode 100644
index aa3c43829..000000000
--- a/debian/workers.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-worker {
- type = "normal";
- bind_socket = "systemd:0";
- mime = true;
-}
-worker {
- type = "controller";
- bind_socket = "systemd:1";
- count = 1;
- password = "q1";
- secure_ip = "127.0.0.1";
- static_dir = "${WWWDIR}";
-} \ No newline at end of file