[Pkg-sysvinit-devel] Bug#523346: wrong parsing of kernel command line (noswap vs noswapaccount etc)

Michael Tokarev mjt at corpit.ru
Thu Apr 9 14:05:54 UTC 2009


Package: initscripts
Version: 2.86.ds1-61
Severity: normal
Tags: patch

Current initscripts checks kernel command line in /lib/init/vars.sh
to set some variables which are used later in various /etc/init.d/*
scripts.  In particular, it has the following test:

if [ -r /proc/cmdline ] && grep -q ' noswap' /proc/cmdline ; then

this matches, in particular, 'noswapaccount', which is wrong.

Provided patch fixes it. Note that the following test in the
same file, for `quiet', is done the right way.

---------------------------------------------------
--- vars.sh.orig	2007-12-23 12:30:21.000000000 +0300
+++ vars.sh	2009-04-09 18:03:38.000000000 +0400
@@ -7,5 +7,5 @@
 # check for bootoption 'noswap' and do not activate swap
 # partitions/files when it is set.
-if [ -r /proc/cmdline ] && grep -q ' noswap' /proc/cmdline ; then
+if [ -r /proc/cmdline ] && grep -qw 'noswap' /proc/cmdline ; then
     NOSWAP=yes
 else
---------------------------------------------------


-- System Information:
Debian Release: lenny/sid
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'testing'), (50, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.27-i686smp
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)

Versions of packages initscripts depends on:
ii  debianutils                  2.17        Miscellaneous utilities specific t
ii  e2fsprogs                    1.41.3-1    ext2/ext3/ext4 file system utiliti
ii  libc6                        2.7-18      GNU C Library: Shared libraries
ii  lsb-base                     3.2-20      Linux Standard Base 3.2 init scrip
ii  mount                        2.12r-19    Tools for mounting and manipulatin
ii  sysvinit-utils               2.86.ds1-61 System-V-like utilities

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

-- no debconf information





More information about the Pkg-sysvinit-devel mailing list