diff options
Diffstat (limited to 'meta-webserver/recipes-httpd/sthttpd/sthttpd/init')
-rw-r--r-- | meta-webserver/recipes-httpd/sthttpd/sthttpd/init | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/meta-webserver/recipes-httpd/sthttpd/sthttpd/init b/meta-webserver/recipes-httpd/sthttpd/sthttpd/init new file mode 100644 index 000000000..f5f7b0124 --- /dev/null +++ b/meta-webserver/recipes-httpd/sthttpd/sthttpd/init | |||
@@ -0,0 +1,52 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: thttpd | ||
5 | # Required-Start: $remote_fs $syslog | ||
6 | # Required-Stop: $remote_fs $syslog | ||
7 | # Default-Start: 2 3 4 5 | ||
8 | # Default-Stop: 0 1 6 | ||
9 | # Short-Description: Small http server | ||
10 | # Description: thttpd is a simple, small, portable, fast, and secure HTTP server. | ||
11 | ### END INIT INFO | ||
12 | |||
13 | |||
14 | thttpd=/usr/sbin/thttpd | ||
15 | test -x "$thttpd" || exit 0 | ||
16 | |||
17 | |||
18 | case "$1" in | ||
19 | start) | ||
20 | echo -n "Starting thttpd" | ||
21 | start-stop-daemon --start --quiet --exec $thttpd -- -C @@CONFFILE | ||
22 | echo "." | ||
23 | ;; | ||
24 | stop) | ||
25 | echo -n "Stopping thttpd" | ||
26 | start-stop-daemon --stop --quiet --exec $thttpd | ||
27 | echo "." | ||
28 | ;; | ||
29 | reload|force-reload) | ||
30 | start-stop-daemon --stop --quiet --signal 1 --exec $thttpd | ||
31 | ;; | ||
32 | restart) | ||
33 | echo -n "Stopping thttpd" | ||
34 | start-stop-daemon --stop --quiet --exec $thttpd -- -C @@CONFFILE | ||
35 | echo "." | ||
36 | echo -n "Waiting for thttpd to die off" | ||
37 | for i in 1 2 3 ; | ||
38 | do | ||
39 | sleep 1 | ||
40 | echo -n "." | ||
41 | done | ||
42 | echo "" | ||
43 | echo -n "Starting thttpd" | ||
44 | start-stop-daemon --start --quiet --exec $thttpd -- -C @@CONFFILE | ||
45 | echo "." | ||
46 | ;; | ||
47 | *) | ||
48 | echo "Usage: /etc/init.d/thttpd {start|stop|reload|restart|force-reload}" | ||
49 | exit 1 | ||
50 | esac | ||
51 | |||
52 | exit 0 | ||