#!/bin/sh # # readlog This shell script takes care of starting and stopping # readlog. # # chkconfig: 2345 30 70 # description: readlog, part of smtp-poplock package # # IMPORTANT NOTE: This script works for the daemontools package # (http://cr.yp.to/daemontools.html) version 0.53 and not later # versions. In version 0.60 Dan went and greatly changed how # supervise works (http://cr.yp.to/daemontools/upgrade.html). SUPERVISE_DIR=/var/run/readlog # make sure the directory exists if [ ! -d $SUPERVISE_DIR ]; then mkdir $SUPERVISE_DIR fi # See how we were called. case "$1" in start) # Start daemons. echo -n "Starting readlog: " supervise /var/run/readlog readlog & echo "done" ;; stop) # Stop daemons. echo -n "Shutting down readlog: " svc -dx /var/run/readlog echo "done" ;; restart) # Stop daemons. echo -n "Shutting down readlog: " svc -dx /var/run/readlog echo "done" # Start daemons. echo -n "Starting readlog: " supervise /var/run/readlog readlog & echo "done" ;; *) echo "Usage: readlog {start|stop|restart}" exit 1 esac exit 0