]> code.ossystems Code Review - openembedded-core.git/commitdiff
sysvinit: bootlogd: Don't run savelog if it's not installed
authorRichard Tollerton <rich.tollerton@ni.com>
Tue, 22 Jul 2014 20:23:35 +0000 (15:23 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 23 Jul 2014 20:47:17 +0000 (21:47 +0100)
bootlogd's default log rotation code on stop requires `savelog`, which
is in debianutils, which may not be installed.  If it's not installed,
don't try to perform the log rotation.

That is: in the affected code block, `savelog` is what is responsible
for creating "boot.0".  When `savelog` doesn't exist, an error message
gets printed on bootup to the effect of "mv: can't find boot.0".

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/sysvinit/sysvinit/bootlogd.init

index 06af465a5b52fd1cbd748f850a2b547d4bd53e86..df5aa430cfb8f593e293386abca392f539d19db6 100755 (executable)
@@ -63,8 +63,8 @@ case "$ACTION" in
                [ "${VERBOSE}" != "no" ] && echo -n "Stopping $DESC: "
                start-stop-daemon --stop --quiet --exec $DAEMON
 
-               if [ "$STOPPER" ] && [ -f /var/log/boot ] && \
-                  [ -f /var/log/boot~ ]
+               if [ "$STOPPER" ] && [ "$(which savelog 2>/dev/null)" ] && \
+                  [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
                then
                        cd /var/log
                        chgrp adm boot