#!/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 }