From 369a7f71ab5cfa16d3cf2990a253684029f126d1 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Fri, 6 Mar 2015 23:09:04 +0000 Subject: [PATCH] Reorganize configuration files for systemd Common systemd/non-systemd options were moved to .inc files. rspamd.conf is systemd-enabled one, rspamd.sysvinit.conf is sysvinit-compatible one. --- conf/common.conf | 17 +++++++++++++++++ conf/logging.conf | 7 ------- conf/logging.inc | 3 +++ conf/options.conf | 18 ------------------ conf/options.inc | 15 +++++++++++++++ conf/rspamd.conf | 30 +++++++++++++++--------------- conf/rspamd.sysvinit.conf | 22 ++++++++++++++++++++++ conf/worker-controller.inc | 7 +++++++ conf/worker-normal.inc | 4 ++++ conf/workers.conf | 15 --------------- debian/logging.conf | 4 ---- debian/workers.conf | 13 ------------- 12 files changed, 83 insertions(+), 72 deletions(-) create mode 100644 conf/common.conf delete mode 100644 conf/logging.conf create mode 100644 conf/logging.inc delete mode 100644 conf/options.conf create mode 100644 conf/options.inc create mode 100644 conf/rspamd.sysvinit.conf create mode 100644 conf/worker-controller.inc create mode 100644 conf/worker-normal.inc delete mode 100644 conf/workers.conf delete mode 100644 debian/logging.conf delete mode 100644 debian/workers.conf diff --git a/conf/common.conf b/conf/common.conf new file mode 100644 index 000000000..d00a42679 --- /dev/null +++ b/conf/common.conf @@ -0,0 +1,17 @@ +# A common rspamd configuration file + +lua = "$CONFDIR/lua/rspamd.lua" + +.include "$CONFDIR/metrics.conf" +.include "$CONFDIR/composites.conf" + +.include "$CONFDIR/statistic.conf" + +.include "$CONFDIR/modules.conf" + +# User local settings +.try_include "$CONFDIR/rspamd.conf.local" + +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..c13b1778f --- /dev/null +++ b/conf/options.inc @@ -0,0 +1,15 @@ +# 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; +} diff --git a/conf/rspamd.conf b/conf/rspamd.conf index 3330f01d9..06dbe8599 100644 --- a/conf/rspamd.conf +++ b/conf/rspamd.conf @@ -1,20 +1,20 @@ -# A common rspamd configuration file +.include "$CONFDIR/common.conf" -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" +options { + .include "$CONFDIR/options.inc" +} -.include "$CONFDIR/modules.conf" +logging { + type = "console"; + .include "$CONFDIR/logging.inc" +} -# User local settings -.try_include "$CONFDIR/rspamd.conf.local" +worker { + bind_socket = "systemd:0"; + .include "$CONFDIR/worker-normal.inc" +} -modules { - path = "$PLUGINSDIR/lua/" +worker { + bind_socket = "systemd:1"; + .include "$CONFDIR/worker-controller.inc" } 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..5e1132f84 --- /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/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/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 -- 2.39.5