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

Bug#392314: /etc/init.d/discover should not assume /proc/modules exists



Package: discover1
Version: 1.7.18
Tags: patch

/etc/init.d/discover assumes /proc/modules exists which causes
sed to error if it doesn't exist.  All of the other scripts in
my /etc/init.d check [ -f /proc/modules ] before using it.

Something like this would take care of it, although it's not obvious
to me whether this should return 1 or 0.

--- discover.orig       2006-10-11 00:55:21.000000000 -0700
+++ discover    2006-10-11 00:55:38.000000000 -0700
@@ -161,6 +161,7 @@

 # Determine if the module is already loaded
 is_loaded() {
+    [ -f /proc/modules ] || return 1
     module="$1"
     aliases="$(get_aliases_regexp $1)"
     # No cut(1) without /usr

Tom.



Reply to: