[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#326412: discover1: Discover initscript requires /var/lib, which may not be mounted

Package: discover1
Version: 1.7.12
Severity: normal
Tags: patch

Many thanks for the quick fix to #316808.  This is a similar problem
which I didn't spot at the time.  The init script uses /var/lib/discover
for a working file.  /var may not be mounted at the first run of
discover, either.

This isn't as serious as #316808 as discover still runs and a
problematic module can be blacklisted manually.

I'll attach a patch which, however, you probably won't want to use,
because it assumes you can write into /lib - probably a wrong assumption.
Should it be /tmp ?


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (2, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.11-1-k7
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages discover1 depends on:
ii  discover1-data              1.2005.07.31 hardware lists for libdiscover1
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an
ii  libdiscover1                1.7.12       hardware identification library

-- debconf information:
* discover/manage_cdrom_devices: true
* discover/cdrom_base_mountpoint: /media/
--- /home/leveret/backports/discover1-1.7.13/discover/discover.init.orig	2005-07-10 17:20:38.000000000 +0100
+++ /home/leveret/backports/discover1-1.7.13/discover/discover.init	2005-09-03 01:38:06.000000000 +0100
@@ -13,6 +13,9 @@
 # file that controls this init script's management of device symlinks
+# module we're loading, if it crashes then we know the culprit and can skip it
 # cache, used more than once
 KVERS=$(uname -r)
@@ -48,12 +51,12 @@
   echo "$result"
-if [ -f /var/lib/discover/crash ]
+if [ -f $CRASHFILE ]
     # The system crashed trying to load a module during the last boot
     # cycle, so add an appropriate "skip" line to the skip file:
-    echo "skip $(</var/lib/discover/crash)" >> $SKIPFILE
-    rm -f /var/lib/discover/crash
+    echo "skip $(<$CRASHFILE)" >> $SKIPFILE
+    rm -f $CRASHFILE
@@ -206,11 +209,11 @@
 	log_success_msg "Loading $MODULE module..."
-    # Note the module being loaded in /var/lib/discover/crash. If loading
+    # Note the module being loaded in $CRASHFILE. If loading
     # the module crashes the machine, this file will exist at the next
     # boot, and we'll add an appropriate "skip" line to the conffile so we
     # don't try to load it again.
-    echo $MODULE > /var/lib/discover/crash
+    echo $MODULE > $CRASHFILE
     # '|| true' make sure we start up, even if one module fails to load.
@@ -218,7 +221,7 @@
     # The module loaded without incident, so we can safely remove the crash
     # file.
-    rm -f /var/lib/discover/crash
+    rm -f $CRASHFILE

Reply to: