summaryrefslogtreecommitdiff
path: root/mail-filter/milter-regex/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-01-15 15:51:32 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-01-15 15:51:32 +0000
commit21435953e16cda318a82334ddbadb3b5c36d9ea7 (patch)
treee1810a4b135afce04b34862ef0fab2bfaeb8aeca /mail-filter/milter-regex/files
parent7bc9c63c9da678a7e6fceb095d56c634afd22c56 (diff)
gentoo resync : 15.01.2020
Diffstat (limited to 'mail-filter/milter-regex/files')
-rw-r--r--mail-filter/milter-regex/files/milter-regex-init31
1 files changed, 31 insertions, 0 deletions
diff --git a/mail-filter/milter-regex/files/milter-regex-init b/mail-filter/milter-regex/files/milter-regex-init
new file mode 100644
index 000000000000..d20b6fa8a30c
--- /dev/null
+++ b/mail-filter/milter-regex/files/milter-regex-init
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile="/run/${RC_SVCNAME}.pid"
+command="/usr/bin/milter-regex"
+command_args="-c ${MR_CONF} -r ${pidfile} -u ${MR_USER} -p ${MR_SOCKET} -P ${MR_PERM} -U ${MR_USER} -G ${MR_GROUP} ${MR_OPTS}"
+extra_commands="configtest"
+description_configtest="Test configuration file correctness."
+
+depend() {
+ before mta
+}
+
+configtest() {
+ ebegin "Checking configuration file ${MR_CONF}"
+ ${command} -d -t -c "${MR_CONF}" || eend "Configuration errors found"
+}
+
+start_pre() {
+ if [ "${RC_CMD}" != "restart" ]; then
+ configtest || return 1
+ checkpath --directory --mode 0755 --owner ${MR_USER}:${MR_GROUP} ${MR_RUNDIR}
+ fi
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ configtest || return 1
+ fi
+}