Start & Stop

Could be used as a template in /etc/init.d

#! /bin/sh
### BEGIN INIT INFO
# Provides:          skeleton
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Example initscript
# Description:       This file should be used to construct scripts to be
#                    placed in /etc/init.d.
### END INIT INFO

# 
test -f "/etc/foo.conf" || exit 1

case "$1" in
start)  echo -n "Starting foo"
        ...
        echo "."
        ;;
stop)   echo -n "Stopping foo"
        ...
        echo "."
        ;;
restart) echo -n "Restarting foo"
        ...
        sleep 2
        ...
        echo "."
        ;;
*)      echo "Usage: /etc/init.d/foo start|stop|restart"
        exit 1
        ;;
esac
exit 0
shell/start_stop.txt · Last modified: 2014-03 by tb
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready