Package: vrfydmn
Version: 0.11.0-1
Hello,
the init script loads /etc/default/vrfydmn OR uses predefined variables.
This may be inconvenient to use default file for overrides.
Also, the script uses hardcoded name "vrfydmn" even for RUNDIR that is
configurable.
I'm attaching patch that sets variables first and loads
/etc/default/vrfydmn after, allowing to use or override defaults.
it also uses the unused EXTRAAFTER variable.
Finally I fixed typo and skipped "for postfix" part, hopefully it could work
with sendmail too.
--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Christian Science Programming: "Let God Debug It!".
--- vrfydmn.orig 2019-07-08 14:52:03.000000000 +0200
+++ vrfydmn 2022-05-30 15:34:49.923077589 +0200
@@ -8,34 +8,32 @@
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start vrfydmn daemon
-# Description: Start up vrfydmn, a anti-spoofing milter for Postfix
+# Description: Start up vrfydmn, an anti-spoofing milter
### END INIT INFO
. /lib/lsb/init-functions
NAME=vrfydmn
-
-# Include defaults if available
-if [ -f /etc/default/vrfydmn ] ; then
- . /etc/default/vrfydmn
-else
-RUNDIR=/var/run/vrfydmn
-SOCKET=local:$RUNDIR/vrfydmn.sock
+RUNDIR=/var/run/${NAME}
+SOCKET=local:${RUNDIR}/${NAME}.sock
USER=vrfydmn
GROUP=vrfydmn
-PIDFILE=$RUNDIR/$NAME.pid
-fi
-
+PIDFILE=${RUNDIR}/${NAME}.pid
COMMAND="/usr/sbin/${NAME}"
+# Include defaults if available
+if [ -f /etc/default/${NAME} ] ; then
+ . /etc/default/${NAME}
+fi
+
start_daemon() {
- mkdir -p /var/run/${NAME}
- chown $USER:$GROUP /var/run/${NAME}
+ mkdir -p ${RUNDIR}
+ chown $USER:$GROUP ${RUNDIR}
echo "Starting ${NAME}"
start-stop-daemon --start --pidfile "${PIDFILE}" \
--exec ${COMMAND} -- -p "${PIDFILE}" -s $SOCKET \
- -u $USER -g $GROUP
+ -u $USER -g $GROUP $EXTRAAFTER
return $?
}
@@ -64,7 +62,7 @@
$0 stop && $0 start
;;
status)
- status_of_proc -p ${PIDFILE} vrfydmn vrfydmn && exit 0 || exit $?
+ status_of_proc -p ${PIDFILE} ${NAME} ${NAME} && exit 0 || exit $?
;;
*)
echo "Usage: ${NAME} {start|stop|restart|reload|status}" >&2