debian/init.d.ex
branchfoerste
changeset 66 4a82fe38a5c6
parent 65 4449f03b7878
child 67 07d8727caf14
equal deleted inserted replaced
65:4449f03b7878 66:4a82fe38a5c6
     1 #! /bin/sh
       
     2 #
       
     3 # skeleton	example file to build /etc/init.d/ scripts.
       
     4 #		This file should be used to construct scripts for /etc/init.d.
       
     5 #
       
     6 #		Written by Miquel van Smoorenburg <miquels@cistron.nl>.
       
     7 #		Modified for Debian GNU/Linux
       
     8 #		by Ian Murdock <imurdock@gnu.ai.mit.edu>.
       
     9 #
       
    10 # Version:	@(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
       
    11 #
       
    12 # This file was automatically customized by dh-make on Fri,  4 Apr 2003 10:03:49 +0200
       
    13 
       
    14 PATH=/sbin:/bin:/usr/sbin:/usr/bin
       
    15 DAEMON=/usr/sbin/logbuch
       
    16 NAME=logbuch
       
    17 DESC=logbuch
       
    18 
       
    19 test -f $DAEMON || exit 0
       
    20 
       
    21 set -e
       
    22 
       
    23 case "$1" in
       
    24   start)
       
    25 	echo -n "Starting $DESC: "
       
    26 	start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
       
    27 		--exec $DAEMON
       
    28 	echo "$NAME."
       
    29 	;;
       
    30   stop)
       
    31 	echo -n "Stopping $DESC: "
       
    32 	start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \
       
    33 		--exec $DAEMON
       
    34 	echo "$NAME."
       
    35 	;;
       
    36   #reload)
       
    37 	#
       
    38 	#	If the daemon can reload its config files on the fly
       
    39 	#	for example by sending it SIGHUP, do it here.
       
    40 	#
       
    41 	#	If the daemon responds to changes in its config file
       
    42 	#	directly anyway, make this a do-nothing entry.
       
    43 	#
       
    44 	# echo "Reloading $DESC configuration files."
       
    45 	# start-stop-daemon --stop --signal 1 --quiet --pidfile \
       
    46 	#	/var/run/$NAME.pid --exec $DAEMON
       
    47   #;;
       
    48   restart|force-reload)
       
    49 	#
       
    50 	#	If the "reload" option is implemented, move the "force-reload"
       
    51 	#	option to the "reload" entry above. If not, "force-reload" is
       
    52 	#	just the same as "restart".
       
    53 	#
       
    54 	echo -n "Restarting $DESC: "
       
    55 	start-stop-daemon --stop --quiet --pidfile \
       
    56 		/var/run/$NAME.pid --exec $DAEMON
       
    57 	sleep 1
       
    58 	start-stop-daemon --start --quiet --pidfile \
       
    59 		/var/run/$NAME.pid --exec $DAEMON
       
    60 	echo "$NAME."
       
    61 	;;
       
    62   *)
       
    63 	N=/etc/init.d/$NAME
       
    64 	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
       
    65 	echo "Usage: $N {start|stop|restart|force-reload}" >&2
       
    66 	exit 1
       
    67 	;;
       
    68 esac
       
    69 
       
    70 exit 0