diff options
Diffstat (limited to 'net-analyzer/fprobe/files/init.d-fprobe-r1')
-rw-r--r-- | net-analyzer/fprobe/files/init.d-fprobe-r1 | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/net-analyzer/fprobe/files/init.d-fprobe-r1 b/net-analyzer/fprobe/files/init.d-fprobe-r1 new file mode 100644 index 000000000000..2dc84b8bfbe9 --- /dev/null +++ b/net-analyzer/fprobe/files/init.d-fprobe-r1 @@ -0,0 +1,40 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net +} + +BIN=/usr/sbin/fprobe +PIDFILE_EXTRA="" +[ -n "$PIDFILE_ID" ] && PIDFILE_EXTRA="[$PIDFILE_ID]" +PIDFILE="/var/run/fprobe$PIDFILE_EXTRA.pid" + +start() { + ebegin "Starting fprobe" + local OPTS="" + [ "${PROMISC}" = "yes" ] || OPTS="${OPTS} -p" + for optname in i:IFACE 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 S:SNAPLEN \ + 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 $BIN \ + --pidfile ${PIDFILE} \ + -- -f "${FILTER}" ${OPTS} + eend $? +} + +stop() { + ebegin "Stopping fprobe" + start-stop-daemon --stop --quiet --exec $BIN \ + --pidfile ${PIDFILE} + eend $? +} + +# vim:ft=gentoo-init-d: |