diff options
Diffstat (limited to 'sys-apps/busybox/files/busybox-sysklogd.initd')
-rw-r--r-- | sys-apps/busybox/files/busybox-sysklogd.initd | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sys-apps/busybox/files/busybox-sysklogd.initd b/sys-apps/busybox/files/busybox-sysklogd.initd new file mode 100644 index 0000000..85e87d1 --- /dev/null +++ b/sys-apps/busybox/files/busybox-sysklogd.initd @@ -0,0 +1,38 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/busybox-sysklogd/files/busybox-sysklogd.initd,v 1.1 2012/08/21 12:44:33 sbriesen Exp $ + +depend() { + need clock hostname + provide logger +} + +start() { + local retval=0 daemon="busybox syslogd" + ebegin "Starting busybox-sysklogd" + start-stop-daemon --start --quiet --exec /bin/busybox syslogd --pidfile /var/run/syslogd.pid -- ${SYSLOGD_OPTS} + retval=${?} + if [ ${retval} -eq 0 ]; then + daemon="busybox klogd" + start-stop-daemon --start --quiet --exec /bin/busybox klogd -- ${KLOGD_OPTS} + retval=${?} + if [ ${retval} -ne 0 ]; then + start-stop-daemon --stop --retry 15 --quiet --exec /bin/busybox syslogd --pidfile /var/run/syslogd.pid + fi + fi + eend ${retval} "Failed to start ${daemon}" +} + +stop() { + local retval=0 daemon="busybox klogd" + ebegin "Stopping busybox-sysklogd" + start-stop-daemon --stop --retry 15 --quiet --exec /bin/busybox klogd + retval=${?} + if [ ${retval} -eq 0 ]; then + daemon="busybox syslogd" + start-stop-daemon --stop --retry 15 --quiet --exec /bin/busybox syslogd --pidfile /var/run/syslogd.pid + retval=${?} + fi + eend ${retval} "Failed to stop ${daemon}" +} |