fix packaging

This commit is contained in:
2020-11-17 10:39:56 +01:00
parent 440ee391b1
commit f6513bccd5
6 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
# /etc/conf.d/pymodmilter: config file for /etc/init.d/pymodmilter
# Start the daemon as the user. You can optionally append a group name here also.
# USER="daemon"
# USER="daemon:nobody"
# Optional parameters for pymodmilter
# MILTER_OPTS=""

View File

@@ -0,0 +1,46 @@
#!/sbin/openrc-run
user=${USER:-daemon}
milter_opts="${MILTER_OPTS:-}"
pidfile="/run/${RC_SVCNAME}.pid"
command="/usr/bin/pymodmilter"
command_args="${milter_opts}"
command_background=true
start_stop_daemon_args="--user ${user}"
extra_commands="configtest"
depend() {
need net
before mta
}
checkconfig() {
OUTPUT=$( ${command} ${command_args} -t 2>&1 )
ret=$?
if [ $ret -ne 0 ]; then
eerror "${SVCNAME} has detected an error in your configuration:"
printf "%s\n" "${OUTPUT}"
fi
return $ret
}
configtest() {
ebegin "Checking ${SVCNAME} configuration"
checkconfig
eend $?
}
start_pre() {
if [ "${RC_CMD}" != "restart" ]; then
checkconfig || return $?
fi
}
stop_pre() {
if [ "${RC_CMD}" != "restart" ]; then
checkconfig || return $?
fi
}