fprobe-ulog.initd 1.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
	need net
	after firewall
}

PIDFILE_EXTRA=""
[ -n "$PIDFILE_ID" ] && PIDFILE_EXTRA="[$PIDFILE_ID]"
12
PIDFILE="/var/run/fprobe-ulog$PIDFILE_EXTRA.pid"
13 14

start() {
15
	ebegin "Starting fprobe-ulog"
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
	local OPTS=""
	set --
	[ -n "${FILTER}" ] && set -- -f "${FILTER}"
	for optname in s:TIMER_EXPIRED g:TIME_FRAGMENTED d:TIMER_IDLE \
		e:TIMER_ACTIVE n:FLOW_VER a:LOCALIP X:SNMP_IFACE b:MEMBULK \
		m:MEMLIMIT q:PENDING B:KERNBUF r:RTPRIO t:DELAY \
		c:CHROOT u:USER v:LOGLEVEL ; do
	    opt="${optname/:*}"	optvar="${optname/*:}"
	    eval optvalue="\$$optvar"
	    [ -n "$optvalue" ] && OPTS="${OPTS} -${opt} ${optvalue}"
	done
	OPTS="${OPTS} -l 1:${PIDFILE_ID} ${COLLECTORS}"
	start-stop-daemon --start --exec $DAEMON \
		--pidfile ${PIDFILE} \
		-- "$@" ${OPTS}
	eend $?
}

stop() {
35
	ebegin "Stopping fprobe-ulog"
36 37 38 39
	start-stop-daemon --stop --quiet --exec $DAEMON \
		--pidfile ${PIDFILE}
	eend $?
}