7 |
7 |
# Should-Stop: postgresql
|
8 |
8 |
# Default-Start: 2 3 4 5
|
9 |
9 |
# Default-Stop: 0 1 6
|
10 |
|
# Short-Description: w.c.s. (Au quotidien)
|
|
10 |
# Short-Description: w.c.s. (Au quotidien) (dummy)
|
11 |
11 |
# Description: w.c.s. Form Server (with Au Quotidien Extension)
|
12 |
12 |
### END INIT INFO
|
13 |
13 |
|
14 |
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
15 |
|
DESC="w.c.s. (+Au Quotidien)"
|
16 |
|
NAME=wcs-auquotidien
|
17 |
|
DAEMON=/usr/sbin/wcsctl
|
18 |
|
PIDFILE=/var/run/$NAME.pid
|
19 |
|
SCRIPTNAME=/etc/init.d/$NAME
|
20 |
|
PYTHON_VERSION=`/usr/bin/env python -c \
|
21 |
|
"import sys; print '%d.%d' % (sys.version_info[0], sys.version_info[1])"`
|
22 |
|
OPTIONS="--extra /usr/lib/pymodules/python$PYTHON_VERSION/auquotidien/"
|
23 |
|
WCS_USER=wcs-au-quotidien
|
24 |
|
WCS_GROUP=wcs-au-quotidien
|
25 |
|
CONFIG_FILE=/etc/wcs/wcs-au-quotidien.cfg
|
26 |
|
|
27 |
|
# Gracefully exit if the package has been removed.
|
28 |
|
test -x $DAEMON || exit 0
|
29 |
|
|
30 |
|
# Read config file if it is present.
|
31 |
|
if [ -r /etc/default/$NAME ]
|
32 |
|
then
|
33 |
|
. /etc/default/$NAME
|
34 |
|
fi
|
35 |
|
|
36 |
|
#
|
37 |
|
# Function that starts the daemon/service.
|
38 |
|
#
|
39 |
|
d_start() {
|
40 |
|
if [ $CONFIG_FILE ]; then
|
41 |
|
$DAEMON -f $CONFIG_FILE collectstatic $OPTIONS
|
42 |
|
start-stop-daemon --start --quiet --pidfile $PIDFILE \
|
43 |
|
--chuid $WCS_USER:$WCS_GROUP --make-pidfile --background \
|
44 |
|
--exec $DAEMON -- -f $CONFIG_FILE start $OPTIONS
|
45 |
|
else
|
46 |
|
$DAEMON collectstatic $OPTIONS
|
47 |
|
start-stop-daemon --start --quiet --pidfile $PIDFILE \
|
48 |
|
--chuid $WCS_USER:$WCS_GROUP --make-pidfile --background \
|
49 |
|
--exec $DAEMON -- start $OPTIONS
|
50 |
|
fi
|
51 |
|
}
|
52 |
|
|
53 |
|
#
|
54 |
|
# Function that stops the daemon/service.
|
55 |
|
#
|
56 |
|
d_stop() {
|
57 |
|
start-stop-daemon --stop --quiet --pidfile $PIDFILE
|
58 |
|
}
|
59 |
|
|
60 |
|
#
|
61 |
|
# Function that sends a SIGHUP to the daemon/service.
|
62 |
|
#
|
63 |
|
d_reload() {
|
64 |
|
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
|
65 |
|
--make-pidfile --background --signal 1
|
66 |
|
}
|
67 |
|
|
68 |
|
case "$1" in
|
69 |
|
start)
|
70 |
|
echo -n "Starting $DESC: $NAME"
|
71 |
|
d_start
|
72 |
|
echo "."
|
73 |
|
;;
|
74 |
|
stop)
|
75 |
|
echo -n "Stopping $DESC: $NAME"
|
76 |
|
d_stop
|
77 |
|
echo "."
|
78 |
|
;;
|
79 |
|
#reload)
|
80 |
|
#
|
81 |
|
# If the daemon can reload its configuration without
|
82 |
|
# restarting (for example, when it is sent a SIGHUP),
|
83 |
|
# then implement that here.
|
84 |
|
#
|
85 |
|
# If the daemon responds to changes in its config file
|
86 |
|
# directly anyway, make this an "exit 0".
|
87 |
|
#
|
88 |
|
# echo -n "Reloading $DESC configuration..."
|
89 |
|
# d_reload
|
90 |
|
# echo "done."
|
91 |
|
#;;
|
92 |
|
restart|force-reload)
|
93 |
|
#
|
94 |
|
# If the "reload" option is implemented, move the "force-reload"
|
95 |
|
# option to the "reload" entry above. If not, "force-reload" is
|
96 |
|
# just the same as "restart".
|
97 |
|
#
|
98 |
|
echo -n "Restarting $DESC: $NAME"
|
99 |
|
d_stop
|
100 |
|
sleep 1
|
101 |
|
d_start
|
102 |
|
echo "."
|
103 |
|
;;
|
104 |
|
*)
|
105 |
|
# echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
|
106 |
|
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
|
107 |
|
exit 1
|
108 |
|
;;
|
109 |
|
esac
|
110 |
|
|
|
14 |
# this is now totally handled by wcs itself
|
111 |
15 |
exit 0
|
debian: adapt to wcs packaging changes (#17976)