Package: bootlogd
Version: 2.88dsf-43
Severity: important
Tags: patch

 There are errors in the script to rotate the log-files of bootlogs.
 The patch is in the attachment.

Regards, Yuri.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages bootlogd depends on:
ii  libc6     2.17-92+b1
ii  lsb-base  4.1+Debian12

bootlogd recommends no packages.

bootlogd suggests no packages.

-- Configuration Files:
/etc/init.d/bootlogd changed [not included]

-- no debconf information

--- bootlogd.dpkg-dist  2013-10-01 20:17:38.336818355 +0400
+++ /etc/init.d/bootlogd        2013-10-01 19:00:30.252675743 +0400
@@ -58,25 +58,23 @@
        ES=$?
        sleep 1
        [ "$VERBOSE" != no ] && log_end_msg $ES
-       if [ -r "$TMPLOG" ]
-       then
-               cat "$TMPLOG" >> /var/log/boot
-               rm -f "$TMPLOG"
-       fi
-       if [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
-       then
-               [ "$VERBOSE" = no ] || log_action_begin_msg "Moving boot log 
file"
-               # bootlogd writes to boot, making backup at boot~
-               cd /var/log && {
-                       chgrp adm boot || :
-                       savelog -q -p -c 5 boot \
-                       && mv boot.0 boot \
-                       && mv boot~ boot.0
-               }
-               ES=$?
-               [ "$VERBOSE" = no ] || log_action_end_msg $ES
-       fi
-       ;;
+        # bootlogd writes to $TMPLOG
+        if [ -r "$TMPLOG" ]; then
+           # 1) rotate logfiles
+           if [ -f /var/log/boot ] ; then
+              [ "$VERBOSE" = no ] || log_action_begin_msg "Moving boot log 
file"
+              cd /var/log && {
+                 chgrp adm boot || :
+                 savelog -q -p -c 5 boot
+              }
+              ES=$?
+              [ "$VERBOSE" = no ] || log_action_end_msg $ES
+          fi
+          # 2) save new file
+          cat "$TMPLOG" >> /var/log/boot
+          rm -f "$TMPLOG"
+        fi
+        ;;
   restart|force-reload)
        /etc/init.d/bootlogd stop
        /etc/init.d/bootlogd start

Reply via email to