lib: Fixed mblock bug for epoll.
[ashd.git] / etc / debian / init.d-ashd
CommitLineData
9f61b28a
FT
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: ashd
4# Required-Start: $local_fs $remote_fs $network $syslog
5# Required-Stop: $local_fs $remote_fs $network $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: The ashd HTTP server
9### END INIT INFO
10
11set -e
12
13. /lib/lsb/init-functions
14
15PATH=/usr/local/bin:/usr/local/sbin:$PATH
16HTPARSER="$(which htparser || true)"
17PIDFILE=/var/run/ashd.pid
18PORTSPEC="plain"
c6b5fb27 19ROOTSPEC="dirplex /srv/www"
9f61b28a
FT
20[ -r /etc/default/locale ] && . /etc/default/locale
21[ -r /etc/default/ashd ] && . /etc/default/ashd
22[ -x "$HTPARSER" ] || exit 0
23
24start() {
25 export LANG
26 log_daemon_msg "Starting HTTP server" "ashd"
9f61b28a
FT
27 start-stop-daemon -S -p "$PIDFILE" -qx "$HTPARSER" -- -Sf -p "$PIDFILE" -u nobody -r /var/tmp $PORTSPEC -- $ROOTSPEC
28 log_end_msg $?
29}
30
31stop() {
32 log_daemon_msg "Stopping HTTP server" "ashd"
33 start-stop-daemon -K -p "$PIDFILE" -qx "$HTPARSER"
34 log_end_msg $?
35}
36
37case "$1" in
38 start)
39 start
40 ;;
41 stop)
42 stop
43 ;;
44 restart)
45 stop
46 start
47 ;;
48esac
49
50exit 0