[Pkg-sysvinit-commits] r1024 - in sysvinit/trunk/debian: . initscripts/etc/network/if-up.d

Petter Reinholdtsen pere at costa.debian.org
Sat Oct 21 07:52:34 UTC 2006


Author: pere
Date: 2006-10-21 07:52:33 +0000 (Sat, 21 Oct 2006)
New Revision: 1024

Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/initscripts/etc/network/if-up.d/mountnfs
Log:
  * Add exit handler in if-up.d/mountnfs to make sure the lock directory
    is removed when the script is interrupted.

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2006-10-21 07:51:59 UTC (rev 1023)
+++ sysvinit/trunk/debian/changelog	2006-10-21 07:52:33 UTC (rev 1024)
@@ -9,6 +9,8 @@
     40_selinux from Manoj Srivastava. (Closes: #394304)
   * Print message when refusing to mount directoryes because the
     lockdir exist.
+  * Add exit handler in if-up.d/mountnfs to make sure the lock directory
+    is removed when the script is interrupted.
 
  -- Petter Reinholdtsen <pere at debian.org>  Thu, 19 Oct 2006 10:05:50 +0200
 

Modified: sysvinit/trunk/debian/initscripts/etc/network/if-up.d/mountnfs
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/network/if-up.d/mountnfs	2006-10-21 07:51:59 UTC (rev 1023)
+++ sysvinit/trunk/debian/initscripts/etc/network/if-up.d/mountnfs	2006-10-21 07:52:33 UTC (rev 1024)
@@ -141,6 +141,10 @@
     exit 0
 fi
 
+on_exit() {
+    # Clean up lock when script exits, even if it is interrupted
+    rmdir /var/run/network/mountnfs 2>/dev/null || exit 0
+}
+trap on_exit EXIT # Enable emergency handler
+
 do_start
-
-rmdir /var/run/network/mountnfs 2>/dev/null || exit 0




More information about the Pkg-sysvinit-commits mailing list