Patchwork [v2,2/3] sysvinit: bootlogd: Don't run savelog if it's not installed

login
register
mail settings
Submitter Ben Shelton
Date July 22, 2014, 8:23 p.m.
Message ID <1406060616-15914-2-git-send-email-ben.shelton@ni.com>
Download mbox | patch
Permalink /patch/76429/
State Accepted
Commit 8076ab295a764fd4aa83c025a8c5deda0549a5c7
Headers show

Comments

Ben Shelton - July 22, 2014, 8:23 p.m.
From: Richard Tollerton <rich.tollerton@ni.com>

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>
---
 meta/recipes-core/sysvinit/sysvinit/bootlogd.init | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
index 06af465..df5aa43 100755
--- a/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
+++ b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
@@ -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