0

I understand that boot log daemon (see this question Starting Bootlog daemon: bootlogd is a part of the init script. But I don't know how to edit this script to disable this daemon. Can some one explain the complete procedure to disable it?

Update

Unfortunately in my linux flavour (petalinux running on arm cortexA 9 based zynq chip) I could not find the file /etc/default.bootlogd:

root@Xilinx-ZC702-14_7:/etc# grep -r "BOOTLOGD_ENABLE" *
init.d/stop-bootlogd:case "$BOOTLOGD_ENABLE" in
init.d/bootlogd:case "$BOOTLOGD_ENABLE" in
rc2.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in
rc3.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in
rc4.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in
rc5.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in
rcS.d/S07bootlogd:case "$BOOTLOGD_ENABLE" in

Now I am unable to understand where should I make change?

Here is the out put of vi init.d/bootlogd

! /bin/sh
#
# bootlogd      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.
#
# Version:      @(#)bootlogd  2.85-12  21-Mar-2004  [email protected]
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/sbin/bootlogd
NAME=bootlogd
DESC="Bootlog daemon"

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
                else
                        $DAEMON -r
                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."
                ;;
        *)
                N=${0##*/}
 N=${N#[SK]??}
                echo "Usage: $N {start|stop|restart|force-reload}" >&2
                exit 1
                ;;
esac

exit 0

1 Answer 1

1

If bootlogd is enabled, look at /etc/default/bootlogd, you will see:

# Run bootlogd at startup ?
BOOTLOGD_ENABLE=Yes

You can disable it by changing its value to No:

# Run bootlogd at startup ?
BOOTLOGD_ENABLE=No

Update

bootlogd saves messages to /var/log/boot. You can change default save file by editing BOOTLOGD_OPTS in /etc/init.d/bootlogd:

BOOTLOGD_OPTS="-r -c -l /root/boot.log"
9
  • Thanks, Can you tell me if I make it "yes", where is the log file saved?
    – gpuguy
    Mar 13, 2014 at 6:52
  • Updated answer.
    – cuonglm
    Mar 13, 2014 at 6:59
  • I could not find 'default' directory, see my update
    – gpuguy
    Mar 13, 2014 at 7:36
  • What OS do you use?
    – cuonglm
    Mar 13, 2014 at 7:38
  • petalinux as updated above
    – gpuguy
    Mar 13, 2014 at 7:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .