spf-discuss
[Top] [All Lists]

Re: Starting spfd (FreeBSD)

2003-12-18 09:03:46
So, like, the other day Odhiambo Washington mumbled:

Hi Marc,

Do you have a script to drop into etc/rc.d/ to start spfd?


This is as far as I managed to get before being distracted.
Haven't gotten back to it, and haven't had time to test it yet.

Note, vaguely Debian oriented too.  Use as /etc/init.d/spfd.
Note, the actual lack of a pid file still...

jdl

----------------------------------------------------------------

#!/bin/sh

# spfd init script

PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=spfd
DAEMON=/usr/bin/spfd            # Yeah, should be in /usr/sbin/spfd
DESC="SPF Daemon"
PIDFILE="/var/run/$NAME.pid"
CONF=/etc/default/spfd.conf

export TMPDIR=/tmp
export PATH

# Really go edit /etc/default/spf.conf instead.
OPTIONS="-path=/tmp/spfd"

test -f $CONF && . $CONF

test -f $DAEMON || exit 0

set -e

case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON -- $OPTIONS
        echo "$NAME."
        ;;

  stop)
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --pidfile $PIDFILE --name $PNAME --oknodo
        echo "$NAME."
        ;;

  reload|force-reload)
        echo -n "Reloading $DESC: "
        start-stop-daemon --stop --pidfile $PIDFILE --signal HUP --name $PNAME
        start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON -- $OPTIONS
        echo "$NAME."
        ;;

  restart)
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --pidfile $PIDFILE --name $PNAME \
            --retry 5 --oknodo
        start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON -- $OPTIONS
        echo "$NAME."
        ;;

  *)
        N=/etc/init.d/$SNAME
        echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
        exit 1
        ;;
esac

exit 0

-------
Sender Permitted From: http://spf.pobox.com/
Archives at http://archives.listbox.com/spf-discuss/current/
Latest draft at http://spf.pobox.com/draft-mengwong-spf-02.9.4.txt
To unsubscribe, change your address, or temporarily deactivate your 
subscription, 
please go to 
http://v2.listbox.com/member/?listname(_at_)©#«Mo\¯HÝÜîU;±¤Ö¤Íµø?¡


<Prev in Thread] Current Thread [Next in Thread>