[Pkg-sysvinit-devel] Bug#390572: initscripts: Logic in stop-bootlogd-single script flawed

Sukant Hajra nb8hpuh02 at sneakemail.com
Sun Oct 1 20:47:04 UTC 2006


Package: initscripts
Version: 2.86.ds1-28
Severity: normal


Hi,

/etc/init.d/stop-bootlogd-single currently has logic to detect if the
kernel has been booted in single user mode using the following:

    if [ ! -e /proc/cmdline ] || egrep -qw 'S|single|1' /proc/cmdline
    then
      ...

However, my cmdline looks like this:

    root=/dev/hda2 ro lapic idebus=66 ibm_acpi.experimental=1 \
    resume2=swap:/dev/hda1 acpi_sleep=s3 \
    _bios video=radeonfb:nomtrr,1400x1050-32

The problem is with the "ibm_acpi.experimental=1" part, which is caught
by `egrep -w '1'`.  It appears that symbols like '=' separate words.

I think this should be really easy to fix.  There's a ton of ways to do
it.  Here's one that doesn't use anything fancy:

    for word in $(cat /proc/cmdline); do
      case "$word" in 
        S|single|1) 
          /etc/init.d/bootlogd stop 
          ;;
      esac
    done

Let me know if I've overlooked something.  

Regards,
Sukant

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (90, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.17-hole
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages initscripts depends on:
ii  debianutils                  2.17        Miscellaneous utilities specific t
ii  e2fsprogs                    1.39-1      ext2 file system utilities and lib
ii  libc6                        2.3.6.ds1-4 GNU C Library: Shared libraries
ii  lsb-base                     3.1-15      Linux Standard Base 3.1 init scrip
ii  mount                        2.12r-10    Tools for mounting and manipulatin
ii  sysvinit-utils               2.86.ds1-28 System-V-like utilities

Versions of packages initscripts recommends:
ii  psmisc                        22.3-1     Utilities that use the proc filesy

-- no debconf information




More information about the Pkg-sysvinit-devel mailing list