do not start daemons during installation
[pve-firewall.git] / debian / pvefw-logger.init
1 #!/bin/sh
2
3 ### BEGIN INIT INFO
4 # Provides:        pvefw-logger
5 # Required-Start:  $remote_fs $network $syslog pve-cluster cman clvm
6 # Required-Stop:   $remote_fs $network $syslog pve-cluster cman clvm
7 # Default-Start:   2 3 4 5
8 # Default-Stop:    0 1 6
9 # Short-Description: PVE firewall logger
10 ### END INIT INFO
11
12 . /lib/lsb/init-functions
13
14 PATH=/sbin:/bin:/usr/bin:/usr/sbin
15 DAEMON=/usr/sbin/pvefw-logger
16 NAME=pvefw-logger
17 DESC="PVE firewall logger"
18 PIDFILE=/var/run/pvefw-logger.pid
19
20 test -f $DAEMON || exit 0
21 [ -e /proxmox_install_mode ] && exit 0
22
23 # avoid warnings about uninstalled locales
24 export LC_ALL="C"
25
26 case "$1" in
27         start)
28                 log_daemon_msg "Starting $DESC" "$NAME"
29                 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
30                 log_end_msg $?
31                 ;;
32         stop)
33                 log_daemon_msg "Stopping $DESC" "$NAME"
34                 start-stop-daemon --stop --quiet --retry TERM/2/TERM/15/KILL/2 --pidfile $PIDFILE
35                 log_end_msg $?
36                 ;;
37         reload|restart|force-reload)
38                 log_daemon_msg "Restarting $DESC" "$NAME"
39                 start-stop-daemon --stop --quiet --retry TERM/2/TERM/15/KILL/2 --pidfile $PIDFILE
40                 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
41                 log_end_msg $?
42                 ;;
43         *)
44                 N=/etc/init.d/$NAME
45                 echo "Usage: $N {start|stop|restart|force-reload}"
46                 exit 1
47                 ;;
48 esac
49
50 exit 0