root/trunk/debian/init.d

Revision 1349, 1.9 kB (checked in by darix, 2 years ago)

- merged lighttpd-merge-1.4.x so we finally work in trunk/ ! yeah \o/

  • Property svn:eol-style set to native
Line 
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
8#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
9#
10# Version:      @(#)skeleton  1.9  26-Feb-2001  miquels@cistron.nl
11#
12
13PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
14DAEMON=/usr/sbin/lighttpd
15OPTS="-f /etc/lighttpd/lighttpd.conf"
16NAME=lighttpd
17DESC=lighttpd
18
19test -x $DAEMON || exit 0
20
21# Include lighttpd defaults if available
22if [ -f /etc/default/lighttpd ] ; then
23        . /etc/default/lighttpd
24fi
25
26set -e
27
28case "$1" in
29  start)
30        echo -n "Starting $DESC: "
31        start-stop-daemon --start --quiet  \
32                --pidfile /var/run/$NAME.pid --exec $DAEMON -- $OPTS
33        echo "$NAME."
34        ;;
35  stop)
36        echo -n "Stopping $DESC: "
37        if start-stop-daemon --stop --pidfile /var/run/$NAME.pid \
38                --exec $DAEMON; then
39                rm -f /var/run/$NAME.pid
40                echo "$NAME."
41        fi
42        ;;
43  reload)
44        #
45        #       If the daemon can reload its config files on the fly
46        #       for example by sending it SIGHUP, do it here.
47        #
48        #       If the daemon responds to changes in its config file
49        #       directly anyway, make this a do-nothing entry.
50        #
51        echo "Reloading $DESC configuration files."
52        start-stop-daemon --stop --signal 1 --quiet --pidfile /var/run/$NAME.pid \
53                --exec $DAEMON
54  ;;
55  restart|force-reload)
56        #
57        #       If the "reload" option is implemented, move the "force-reload"
58        #       option to the "reload" entry above. If not, "force-reload" is
59        #       just the same as "restart".
60        #
61        echo -n "Restarting $DESC: "
62        start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/$NAME.pid \
63                --exec $DAEMON
64        rm -f /var/run/$NAME.pid
65        sleep 1
66        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
67                --exec $DAEMON -- $OPTS
68        echo "$NAME."
69        ;;
70  *)
71        N=/etc/init.d/$NAME
72        echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
73        #echo "Usage: $N {start|stop|restart|force-reload}" >&2
74        exit 1
75        ;;
76esac
77
78exit 0
Note: See TracBrowser for help on using the browser.