-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathperl-fastcgi
51 lines (42 loc) · 1.02 KB
/
perl-fastcgi
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
#!/bin/sh
### BEGIN INIT INFO
# Provides: fastcgi-wrapper.pl
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: starts fastcgi-wrapper.pl
### END INIT INFO
set -u
DAEMON="FASTCGI WRAPPER"
FCGI_CMD=/usr/bin/fastcgi-wrapper.pl
FCGI_PID=/var/run/fastcgi-wrapper.pid
TIMEOUT=30
FCGI_OPTIONS=""
SSD_OPTIONS="--oknodo --quiet --pidfile $FCGI_PID --exec $FCGI_CMD"
. /lib/lsb/init-functions
case "$1" in
start)
log_begin_msg "Starting $DAEMON..."
/sbin/start-stop-daemon --start $SSD_OPTIONS -- $FCGI_OPTIONS
log_end_msg $?
;;
stop)
log_begin_msg "Stopping $DAEMON..."
/sbin/start-stop-daemon --stop $SSD_OPTIONS
log_end_msg $?
;;
graceful-stop)
log_begin_msg "Gracefully stopping $DAEMON..."
/sbin/start-stop-daemon --stop --retry QUIT/$TIMEOUT/TERM $SSD_OPTIONS
log_end_msg $?
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|graceful-stop|restart}"
exit 1
;;
esac