Solaris Startup Script From OpenCSW Package

This is the script that comes with the Milter-Greylist package for Solaris from OpenCSW. It's created as /etc/init.d/cswmiltergreylist with symlinks from /etc/rc1.d/K28cswmiltergreylist and /etc/rc2.d/S78cswmiltergreylist.

If you're going to use it for something else check the paths carefully.

#!/sbin/sh

MILDIR=/var/opt/csw/milter-greylist
BINDIR=/opt/csw/bin
USER=greylist

#OPTIONS="-v -w 14m"
OPTIONS="-u $USER -f /opt/csw/etc/mail/greylist.conf"

case "$1" in
  start)
        # Start daemon
        echo "Starting milter-greylist: ... \c"
        chown $USER $MILDIR
        ulimit -n 1024
        $BINDIR/milter-greylist $OPTIONS
        echo "done"
        ;;
  stop)
        # Stop daemon
        echo "Shutting down milter-greylist: ... \c"
        /usr/bin/kill `cat $MILDIR/milter-greylist.pid`
        echo "done"
        ;;
  restart)
        echo "Restarting milter-greylist: ... "
        $0 stop
        echo "Waiting for milter-greylist to stop: \c"
        while ( pgrep milter-greylist > /dev/null )
        do
          echo ".\c"
          sleep 1
        done
        echo
        sleep 1
        $0 start
        ;;
  *)
        echo "Usage: `basename $0` { start | stop | restart }"
        exit 1
esac

exit 0
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License