[Lunar-commits] CVS: theedge/sbin lrm,1.21,1.22

Auke Kok sofar at lunar-linux.org
Thu Mar 18 12:16:57 GMT 2004


Update of /var/cvs/lunar/theedge/sbin
In directory dbguin.lunar-linux.org:/tmp/cvs-serv10247/sbin

Modified Files:
	lrm 
Log Message:
Bugfix: theedge wasnt removing files from /etc/ at all, and added proper init.d script shutdowns on plain 'lrm' commands, as well as xinetd restarts.


Index: lrm
===================================================================
RCS file: /var/cvs/lunar/theedge/sbin/lrm,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- lrm	14 Mar 2004 21:43:31 -0000	1.21
+++ lrm	18 Mar 2004 12:16:55 -0000	1.22
@@ -67,7 +67,7 @@
 
     if [ "$TARGET_MD5" == "$OLD_MD5" ] ; then
       debug_msg "removing \"$1\""
-      return 1
+      return 0
     fi
 
     if [ "$TARGET_MD5" != "$OLD_MD5" ] ; then
@@ -143,6 +143,17 @@
   # time-out 1: PRE_REMOVE
   run_module_file $MODULE PRE_REMOVE
 
+  # init.d scripts stop before rm phase, but only if ! upgrading
+  if [ "$KEEPCONFIG" != "on" ] ; then
+    # pre-read these variables!
+    SERVICES=$(get_module_config "SERVICES")
+    XINETD=$(get_other_module_config "xinetd" "INITDSCRIPTS")
+    for INITDSCRIPT in $(get_module_config "INITDSCRIPTS") ; do
+      verbose_msg "Stopping service $INITDSCRIPT"
+      ( cd / && /etc/init.d/$INITDSCRIPT stop )
+    done
+  fi
+
   # grep -v the install logs over the protected stuff, this
   # yields the files that may be removed
   cat $INST_LOG | grep -v -f $PROTECTED | while read TARGET ; do
@@ -165,6 +176,11 @@
   else
     verbose_msg "removing module from dependency listing and configs"
     remove_depends $MODULE
+    # restart xinetd after xinetd.confs have been removed by lrm...
+    if [ -n "$SERVICES" -a -n "$XINETD" ] ; then
+      verbose_msg "restarting xinetd"
+      /etc/init.d/xinetd restart
+    fi
   fi
 
   # administration duty time:



More information about the Lunar-commits mailing list