summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin/logsurfer+/files/logsurfer-1.8.initd')
-rw-r--r--app-admin/logsurfer+/files/logsurfer-1.8.initd51
1 files changed, 51 insertions, 0 deletions
diff --git a/app-admin/logsurfer+/files/logsurfer-1.8.initd b/app-admin/logsurfer+/files/logsurfer-1.8.initd
new file mode 100644
index 000000000000..b75c26e04645
--- /dev/null
+++ b/app-admin/logsurfer+/files/logsurfer-1.8.initd
@@ -0,0 +1,51 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+pidfile="/var/run/logsurfer.pid"
+command="/usr/bin/logsurfer"
+command_args="-D -p ${pidfile} ${LOGSURFER_OPTS}"
+extra_started_commands="reload dump"
+
+conffile="/etc/logsurfer.conf"
+
+depend() {
+ use logger
+}
+
+checkconfig() {
+ if [ ! -f /etc/logsurfer.conf ] ; then
+ eerror "Please create /etc/logsurfer.conf"
+ return 1
+ fi
+ return 0
+}
+
+start_pre() {
+ checkconfig || return $?
+
+ checkpath --file --owner logsurfer --mode 0644 "${pidfile}"
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon \
+ --start \
+ --user logsurfer \
+ --exec ${command} \
+ -- ${command_args}
+ eend $? "Failed to start ${SVCNAME}"
+}
+
+reload() {
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $? "Failed to reload ${SVCNAME}"
+}
+
+dump() {
+ ebegin "Dumping ${SVCNAME} internal state"
+ start-stop-daemon --signal USR1 --pidfile "${pidfile}"
+ eend $? "Failed to dump ${SVCNAME} internal state"
+}