forked from od-eon/django-cherrypy-odeon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cherrypy_init_script.debian
executable file
·62 lines (49 loc) · 1 KB
/
cherrypy_init_script.debian
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#! /bin/sh
#
# start/stop Django web server
### BEGIN INIT INFO
# Provides: cherrypy
# Required-Start: $network
# Required-Stop: $network
# Should-Start: $named
# Should-Stop: $named
# Default-Start: S 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the cherrypy python server
# Description: Start the cherrypy python server
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=cherrypy
DAEMON=/path/to/cherrypy_server.sh
USER=foobar
. /lib/lsb/init-functions
set -e
test -x $DAEMON || exit 0
case "$1" in
start)
printf "Starting web server: %s\t" "$NAME"
su $USER -s /bin/sh -c "$DAEMON start"
;;
stop)
printf "Stopping web server: %s\t" "$NAME"
su $USER -s /bin/sh -c "$DAEMON stop"
;;
restart)
su $USER -s /bin/sh -c "$DAEMON restart"
;;
status)
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart}" >&2
exit 1
;;
esac
if [ $? = 0 ]; then
echo .
exit 0
else
echo failed
exit 1
fi
exit 0