[Glibc-bsd-commits] r3771 - trunk/istgt/debian

Arno Töll atoell-guest at alioth.debian.org
Wed Oct 26 23:26:17 UTC 2011


Author: atoell-guest
Date: 2011-10-26 23:26:17 +0000 (Wed, 26 Oct 2011)
New Revision: 3771

Modified:
   trunk/istgt/debian/changelog
   trunk/istgt/debian/init
Log:
Implement a post daemon startup check to make sure istgt is actually running.

Modified: trunk/istgt/debian/changelog
===================================================================
--- trunk/istgt/debian/changelog	2011-10-26 22:10:50 UTC (rev 3770)
+++ trunk/istgt/debian/changelog	2011-10-26 23:26:17 UTC (rev 3771)
@@ -3,8 +3,11 @@
   * New upstream release
   * Add patch `add-istgtcontrol-manpage' which adds a manpage for the
     istgtcontrol command.
+  * Check whether istgt is actually running after starting up the daemon in its
+    init script. That's required because istgt may fail for the socket setup
+    after forking into the background. 
 
- -- Arno Töll <debian at toell.net>  Mon, 24 Oct 2011 21:39:03 -0400
+ -- Arno Töll <debian at toell.net>  Wed, 26 Oct 2011 21:23:20 -0400
 
 istgt (0.4~20110928-1) unstable; urgency=low
 

Modified: trunk/istgt/debian/init
===================================================================
--- trunk/istgt/debian/init	2011-10-26 22:10:50 UTC (rev 3770)
+++ trunk/istgt/debian/init	2011-10-26 23:26:17 UTC (rev 3771)
@@ -52,6 +52,15 @@
 	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
 		$DAEMON_ARGS \
 		|| return 2
+
+	RETVAL=0
+	for i in 1 2 3 4 5 ; do
+		sleep 1
+		status_of_proc -p $PIDFILE "$DAEMON" "$NAME" || RETVAL=$?
+		[ "$RETVAL" = 0 ] && return 0
+	done
+
+	[ "$RETVAL" != 0 ] && return 2
 }
 
 #




More information about the Glibc-bsd-commits mailing list