summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Ruohonen <drear@iki.fi>2007-11-09 13:59:44 +0000
committerJukka Ruohonen <drear@iki.fi>2007-11-09 13:59:44 +0000
commit42ce6de0c3d14388515d85dd766ed8bd3452179f (patch)
tree4b01eff2edf61b660ebb16df4817a5c00fce3abb /net-analyzer/daemonlogger/files
parentFix typo in sci-libs/openfoam mask entry (diff)
downloadsunrise-42ce6de0c3d14388515d85dd766ed8bd3452179f.tar.gz
sunrise-42ce6de0c3d14388515d85dd766ed8bd3452179f.tar.bz2
sunrise-42ce6de0c3d14388515d85dd766ed8bd3452179f.zip
net-analyzer/daemonlogger: Added init scripts and modified the ebuild accordingly.
svn path=/sunrise/; revision=5034
Diffstat (limited to 'net-analyzer/daemonlogger/files')
-rw-r--r--net-analyzer/daemonlogger/files/daemonlogger-confd19
-rw-r--r--net-analyzer/daemonlogger/files/daemonlogger-initd26
2 files changed, 45 insertions, 0 deletions
diff --git a/net-analyzer/daemonlogger/files/daemonlogger-confd b/net-analyzer/daemonlogger/files/daemonlogger-confd
new file mode 100644
index 000000000..39240d3a0
--- /dev/null
+++ b/net-analyzer/daemonlogger/files/daemonlogger-confd
@@ -0,0 +1,19 @@
+# Config file for /etc/init.d/daemonlogger.
+# Note that you can run daemonlogger as a non-daemon without the init script.
+
+# Set the listening interface.
+IFACE="eth0"
+
+# Set the output interface for tapping.
+# Note that this disables the logging option below.
+#TAP="eth1"
+
+# The directory to which logged pcap-files are stored.
+LOGDIR="/var/log/daemonlogger"
+
+# The user/group to which the program drops privileges.
+# Note that if you change this, please adjust the permissions of LOGDIR accordingly.
+USER="daemonlogger"
+
+# This gathers the above options.
+DAEMONLOGGER_OPTS="-d -i $IFACE -u $USER -g $USER -l $LOGDIR"
diff --git a/net-analyzer/daemonlogger/files/daemonlogger-initd b/net-analyzer/daemonlogger/files/daemonlogger-initd
new file mode 100644
index 000000000..3d8c36af3
--- /dev/null
+++ b/net-analyzer/daemonlogger/files/daemonlogger-initd
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+if [[ -n "${TAP}" ]] ; then
+ DAEMONLOGGER_OPTS="${DAEMONLOGGER_OPTS} -o ${TAP}"
+fi
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting daemonlogger on ${IFACE}"
+ start-stop-daemon --start --exec /usr/sbin/daemonlogger \
+ --pidfile /var/run/daemonlogger_$IFACE.pid --background \
+ -- -P /var/run -p daemonlogger_$IFACE.pid ${DAEMONLOGGER_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping daemonlogger on ${IFACE}"
+ start-stop-daemon --stop --quiet --retry 5 --pidfile /var/run/daemonlogger_$IFACE.pid
+ eend $?
+}