]> git.proxmox.com Git - pve-firewall.git/blame - debian/pvefw-logger.init
add missing init.d file for pvefw-logger
[pve-firewall.git] / debian / pvefw-logger.init
CommitLineData
bc5da043
DM
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
14PATH=/sbin:/bin:/usr/bin:/usr/sbin
15DAEMON=/usr/sbin/pvefw-logger
16NAME=pvefw-logger
17DESC="PVE firewall logger"
18PIDFILE=/var/run/pvefw-logger.pid
19
20test -f $DAEMON || exit 0
21
22# avoid warnings about uninstalled locales
23export LC_ALL="C"
24
25case "$1" in
26 start)
27 log_daemon_msg "Starting $DESC" "$NAME"
28 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
29 log_end_msg $?
30 ;;
31 stop)
32 log_daemon_msg "Stopping $DESC" "$NAME"
33 start-stop-daemon --stop --quiet --retry TERM/2/TERM/15/KILL/2 --pidfile $PIDFILE
34 log_end_msg $?
35 ;;
36 reload|restart|force-reload)
37 log_daemon_msg "Restarting $DESC" "$NAME"
38 start-stop-daemon --stop --quiet --retry TERM/2/TERM/15/KILL/2 --pidfile $PIDFILE
39 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
40 log_end_msg $?
41 ;;
42 *)
43 N=/etc/init.d/$NAME
44 echo "Usage: $N {start|stop|restart|force-reload}"
45 exit 1
46 ;;
47esac
48
49exit 0