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
|
#!/bin/sh
### BEGIN INIT INFO
# Provides: gatling
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Gatling
# Description: Gatling - High performance webserver and fileserver
### END INIT INFO
. /lib/lsb/init-functions
LOGFILE=/var/log/gatling.log
DAEMON=tlsgatling
# Include defaults if available
if [ -f /etc/default/gatling ] ; then
. /etc/default/gatling
fi
start() {
if [ "$START_DAEMON" != "YES" ] ; then
log_warning_msg "Not starting Gatling (edit /etc/default/gatling to enable)"
exit 0 ;
fi
log_daemon_msg "Starting Gatling" "$DAEMON"
start-stop-daemon --pidfile /var/run/gatling.pid --make-pidfile \
--background --exec /usr/bin/writelog --start -- \
/var/log/gatling.log /usr/bin/$DAEMON $DAEMON_OPTS
log_end_msg 0
}
stop() {
log_daemon_msg "Stopping Gatling" "$DAEMON"
start-stop-daemon --oknodo --pidfile /var/run/gatling.pid --stop --retry 10
log_end_msg 0
}
hup() {
log_daemon_msg "Stopping Gatling" "$DAEMON"
start-stop-daemon --oknodo --pidfile /var/run/gatling.pid --stop --signal HUP --retry 10
log_end_msg 0
}
restart() {
stop
start
}
reload() {
hup
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|force-reload)
restart
;;
reload)
reload
;;
*)
log_success_msg "Usage: $0 {start|stop|reload|restart}"
exit 1
esac
|