diff options
author | Ralph Seichter <github@seichter.de> | 2019-12-12 23:14:45 +0100 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2019-12-21 17:06:25 +0200 |
commit | bedc1e25d4210aaa580c3068193c7369f58059bc (patch) | |
tree | 45bb550480df90871702239c693a16af25a352fa /mail-filter/milter-regex/files | |
parent | acct-user/milter-regex: new user 438 (diff) | |
download | gentoo-bedc1e25d4210aaa580c3068193c7369f58059bc.tar.gz gentoo-bedc1e25d4210aaa580c3068193c7369f58059bc.tar.bz2 gentoo-bedc1e25d4210aaa580c3068193c7369f58059bc.zip |
mail-filter/milter-regex: Bump to version 2.7
The new version implements a "-t" command line option, allowing
configuration files being tested for correctness before launch.
This new feature is now used in the init.d file.
The ebuild no longer relies on user.eclass but uses a acct-user
dependency, as per GLEP81.
Package-Manager: Portage-2.3.79, Repoman-2.3.16
Signed-off-by: Ralph Seichter <gentoo@seichter.de>
Closes: https://github.com/gentoo/gentoo/pull/13964
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'mail-filter/milter-regex/files')
-rw-r--r-- | mail-filter/milter-regex/files/milter-regex-init | 31 |
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 +} |