From c527fd1f14c27855a37f2e8ac5346ce8d940ced2 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Thu, 16 Oct 2014 03:05:19 +0200 Subject: initial commit for Enea Linux 4.0-140929 Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea --- meta/recipes-core/sysvinit/sysvinit/bootlogd.init | 96 +++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100755 meta/recipes-core/sysvinit/sysvinit/bootlogd.init (limited to 'meta/recipes-core/sysvinit/sysvinit/bootlogd.init') diff --git a/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init new file mode 100755 index 0000000000..7d6518d981 --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init @@ -0,0 +1,96 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: bootlogd +# Required-Start: +# Required-Stop: +# Default-Start: S +# Default-Stop: 2 3 4 5 +# Short-Description: One of the first scripts to be executed. Starts or stops +# the bootlogd log program. If this script is called as +# "stop-bootlogd", it will stop the daemon instead of +# starting it even when called with the "start" argument. +# +### END INIT INFO + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/sbin/bootlogd +NAME=bootlogd +DESC="Bootlog daemon" + +# source function library +. /etc/init.d/functions + +test -f $DAEMON || exit 0 + +[ -r /etc/default/bootlogd ] && . /etc/default/bootlogd + +## set -e # not needed + +case "$BOOTLOGD_ENABLE" in + [Nn]*) + exit 0 + ;; +esac + +STOPPER= +ACTION="$1" +case "$0" in + *stop-bootlog*) + STOPPER=Y + if [ "$ACTION" = start ] + then + ACTION=stop + fi + ;; +esac + +case "$ACTION" in + start) + echo -n "Starting $DESC: " + if [ -d /proc/1/. ] + then + umask 027 + start-stop-daemon --start --quiet \ + --exec $DAEMON -- -r -c + else + $DAEMON -r -c + fi + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --exec $DAEMON + + if [ "$STOPPER" ] && [ -f /var/log/boot ] && \ + [ -f /var/log/boot~ ] + then + cd /var/log + chgrp adm boot + savelog -p -c 5 boot > /dev/null 2>&1 + mv boot.0 boot + mv boot~ boot.0 + fi + + echo "$NAME." + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --exec $DAEMON + sleep 1 + start-stop-daemon --start --quiet --exec $DAEMON + echo "$NAME." + ;; + status) + status $DAEMON + exit $? + ;; + *) + N=${0##*/} + N=${N#[SK]??} + echo "Usage: $N {start|stop|status|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 + -- cgit v1.2.3-54-g00ecf