diff options
Diffstat (limited to 'net-mgmt/mrtg/files/mrtg_daemon.in')
-rw-r--r-- | net-mgmt/mrtg/files/mrtg_daemon.in | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/net-mgmt/mrtg/files/mrtg_daemon.in b/net-mgmt/mrtg/files/mrtg_daemon.in new file mode 100644 index 000000000000..009ba2159674 --- /dev/null +++ b/net-mgmt/mrtg/files/mrtg_daemon.in @@ -0,0 +1,37 @@ +#!/bin/sh +# +# $FreeBSD$ + +# +# PROVIDE: mrtg_daemon +# REQUIRE: DAEMON bsnmpd snmpd + +. %%RC_SUBR%% + + +name="mrtg_daemon" +rcvar=`set_rcvar` + +load_rc_config $name + +: ${mrtg_daemon_enable="NO"} +: ${mrtg_daemon_pidfile="/var/run/mrtg/mrtg.pid"} +: ${mrtg_daemon_user="mrtg"} +: ${mrtg_daemon_group="mrtg"} +: ${mrtg_daemon_config="%%ETCDIR%%/mrtg.cfg"} + +: ${mrtg_daemon_flags="--pid-file $mrtg_daemon_pidfile --lock-file /var/run/mrtg/lockfile --confcache-file /var/run/mrtg/confcache --user $mrtg_daemon_user --group $mrtg_daemon_group --daemon $mrtg_daemon_config"} + +start_precmd="mrtg_daemon_precmd" + +command="%%PREFIX%%/bin/mrtg" +command_interpreter="%%PERL%%" +pidfile=${mrtg_daemon_pidfile} + +mrtg_daemon_precmd() +{ + rm -f /var/run/mrtg/lockfile /var/run/mrtg/confcache $mrtg_daemon_pidfile + export LANG=C +} + +run_rc_command "$1" |