[DRBD-user] /etc/init.d/drbd script

David Krovich dkrovich at csee.wvu.edu
Wed Apr 21 02:51:02 CEST 2004

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


In my drbd debian packages, when I drbd package is removed, first I
attempt to stop the drbd module using /etc/init.d/drbd stop and then
remove the package.  This is now causing a problem.  Consider the
following scenario:

1) User installs package.
2) User attempts to immediately remove the package.

When the package is attempted to be removed, the the /etc/init.d/drbd
script is called with a parameter of stop.  Since the user hasn't
modified the /etc/drbd.conf script, the parse_config option raises an
error since the hostname of the host is not in the /etc/drbd.conf file
so it fails which causes the package removal to fail.

If the drbd module is not loaded, is it necessary to parse the
/etc/drbd.conf file?

I made this quick patch to deal with this, but I wanted to discuss
things further here before I roll out a new package.

--- drbd        2004-04-20 20:27:04.881695448 -0400
+++ my.drbd     2004-04-20 20:26:40.091464136 -0400
@@ -832,6 +832,7 @@
 # parse the configuration, and store this in source-able form
 # on the next invocation we try to read this pre-parsed config
 {
+       [ -e $PROC_DRBD ] || { echo "$link stop: nothing to do."; exit 0; }
        trace0
        [ -z "$_SCRIPT_RECURSION" ] \
        && echo "$link: pre-parsed needs update, parsing $CONFIG"






More information about the drbd-user mailing list