summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--udplogger.rc35
1 files changed, 35 insertions, 0 deletions
diff --git a/udplogger.rc b/udplogger.rc
new file mode 100644
index 0000000..1b205a4
--- /dev/null
+++ b/udplogger.rc
@@ -0,0 +1,35 @@
1#!/bin/sh
2
3# PROVIDE: udplogger
4# REQUIRE: FILESYSTEMS
5# KEYWORD: shutdown
6
7. /etc/rc.subr
8
9name=udplogger
10rcvar="${name}_enable"
11
12udplogger_daemon_user="nobody"
13udplogger_command="/usr/local/bin/udplogger"
14udplogger_command_flags="/var/log/udplogger"
15
16pidfile="/var/run/${name}.pid"
17
18command="/usr/sbin/daemon"
19command_args="-r -o /var/log/udplogger.log -u ${udplogger_daemon_user} -P ${pidfile} ${udplogger_command} ${udplogger_command_flags}"
20
21stop_postcmd="udplogger_shutdown"
22
23udplogger_shutdown()
24{
25 if [ -e "${pidfile}" ]; then
26 echo "Stopping supervising daemon."
27 kill -s TERM `cat ${pidfile}`
28 fi
29}
30
31load_rc_config $name
32: ${udplogger_enable:=no}
33
34run_rc_command "$1"
35