This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
renderQueued
executable file
·87 lines (80 loc) · 1.66 KB
/
renderQueued
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh
#
# $Id$
#
# renderQueued initscript for townguide renderQueue.py
# This file should be placed in /etc/init.d.
#
# Original Author: Graham Jones
#
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="renderQueue townguide job queue manager"
NAME=renderQueue
DAEMON=/var/www/townguide/$NAME
PIDFILE=/var/www/townguide/www/output/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
USER=www
LOGDIR=/var/www/townguide/www/output
# Read config file if it is present.
if [ -r /etc/default/$NAME ]
then
. /etc/default/$NAME
fi
#
# Function that starts the daemon/service.
#
d_start() {
start-stop-daemon --start \
--chuid $USER \
--exec $DAEMON \
--pidfile $PIDFILE \
-- \
--daemon \
--logdir $LOGDIR \
--config /var/www/townguide/townguide.cfg \
--pid_file $PIDFILE \
-r
}
# Function that stops the daemon/service.
#
d_stop() {
start-stop-daemon -o --stop --name renderQueue
}
#
# Function that sends a SIGHUP to the daemon/service.
#
d_reload() {
start-stop-daemon --stop --quiet \
--name $NAME --signal 1
}
case "$1" in
start)
echo -n "Starting $DESC"
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC"
d_stop
echo "."
;;
restart|force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
#
echo -n "Restarting $NAME"
d_stop
sleep 1
d_start
echo "."
;;
*)
# echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0