You are looking at historical revision 29905 of this page. It may differ significantly from its current revision.

Here's an example init.d script for Spiffy the webserver, for use on Debian derivatives (created by Mario Domenech Goulart)

#! /bin/sh
# -*- shell-script -*-

# This is /etc/init.d/spiffy on Debian systems
# It assumes you have a "spiffy.scm" script in /usr/local/libexec and a log directory in /var/log/spiffy

# Select which "csi" program to use; defaults to the one in $PATH
CSI=csi
# Use a longer trace buffer and a larger nursery size (optional)
CSI_ARGS="-:s1m -:a200 -s"

DATE_FORMAT="+%Y-%m-%d %H:%M:%S"

spiffy_start () {
    echo "Starting spiffy..."
    echo "start: " `date "$DATE_FORMAT"` >> /var/log/spiffy/start-stop.log
    (cd /var/log/spiffy; ulimit -c unlimited ; $CSI $CSI_ARGS /usr/local/libexec/spiffy.scm &)  </dev/null &> /var/log/spiffy/init.log
}

spiffy_stop () {
    echo "Stopping spiffy..."
    echo "stop: " `date "$DATE_FORMAT"` >> /var/log/spiffy/start-stop.log
    pids=`ps ax | grep "[/]usr/local/libexec/spiffy.scm" | awk '{print $1}'`
    if [ -z "$pids" ] ; then
       echo "spiffy is not running"
    else
        for pid in $pids; do
            echo "killing " $pid
            kill $pid
        done
    fi
}

case "$1" in
    start)
        spiffy_start
        ;;
    stop)
        spiffy_stop
        ;;
    restart)
        spiffy_stop
        sleep 1
        spiffy_start
        ;;
    *) exit 1
esac