SVN: rc-scripts/trunk: doc/upstart.txt init/rc.conf rc.d/init.d/network

glen glen at pld-linux.org
Sun Oct 9 20:14:39 CEST 2011


Author: glen
Date: Sun Oct  9 20:14:39 2011
New Revision: 12366

Modified:
   rc-scripts/trunk/doc/upstart.txt
   rc-scripts/trunk/init/rc.conf
   rc-scripts/trunk/rc.d/init.d/network
Log:
let "network" emit network starting/stopping/started/stopped events as well

Modified: rc-scripts/trunk/doc/upstart.txt
==============================================================================
--- rc-scripts/trunk/doc/upstart.txt	(original)
+++ rc-scripts/trunk/doc/upstart.txt	Sun Oct  9 20:14:39 2011
@@ -53,15 +53,19 @@
         when rc.shutdown starts
 
 pld.network-starting
+starting network
         just before network initialization is started
 
 pld.network-started
+started network
         when network is initialized
 
 pld.network-stopping
+stopping network
         just before network shutdown is started
 
 pld.network-stopped
+stopped network
         when network configuration is shut down
 
 Jobs
@@ -207,6 +211,8 @@
      when previously running job was not properly killed, when bad 'expect' was
      used or when the daemon does weird forking on startup.
 
+See also http://upstart.ubuntu.com/wiki/Debugging
+
 Updating init scripts
 ---------------------
 

Modified: rc-scripts/trunk/init/rc.conf
==============================================================================
--- rc-scripts/trunk/init/rc.conf	(original)
+++ rc-scripts/trunk/init/rc.conf	Sun Oct  9 20:14:39 2011
@@ -7,6 +7,7 @@
 stop on runlevel [!$RUNLEVEL]
 
 emits shutdown
+emits network
 
 # rc.sysinit
 emits pld.sysinit-done
@@ -15,10 +16,10 @@
 emits pld.shutdown-started
 
 # /etc/rc.d/init.d/network
-emits  pld.network-starting
-emits  pld.network-started
-emits  pld.network-stopping
-emits  pld.network-stopped
+emits pld.network-starting
+emits pld.network-started
+emits pld.network-stopping
+emits pld.network-stopped
 
 task
 

Modified: rc-scripts/trunk/rc.d/init.d/network
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/network	(original)
+++ rc-scripts/trunk/rc.d/init.d/network	Sun Oct  9 20:14:39 2011
@@ -194,6 +194,8 @@
 
 start() {
 	emit pld.network-starting
+	emit starting JOB=network
+
 	rc_splash "bootnetwork start"
 	network_init
 
@@ -214,10 +216,12 @@
 
 	touch /var/lock/subsys/network
 	emit --no-wait pld.network-started
+	emit --no-wait started JOB=network
 }
 
 stop() {
 	emit pld.network-stopping
+	emit stopping JOB=network
 	# If we go to runlevel 0, 1 or 6 then umount all network fs
 	if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
 		if [ -x /etc/rc.d/init.d/netfs -a -f /var/lock/subsys/netfs ];
@@ -243,6 +247,7 @@
 
 	rm -f /var/lock/subsys/network >/dev/null 2>&1
 	emit --no-wait pld.network-stopped
+	emit --no-wait stopped JOB=network
 }
 
 # Reload all active interfaces
@@ -324,8 +329,10 @@
   start)
 	if is_yes "$VSERVER_ISOLATION_NET"; then
 		emit pld.network-starting
+		emit starting JOB=network
 		touch /var/lock/subsys/network
 		emit pld.network-started
+		emit --no-wait started JOB=network
 		exit 0
 	fi
   	start
@@ -334,8 +341,10 @@
   stop)
 	if is_yes "$VSERVER_ISOLATION_NET"; then
 		emit pld.network-stopping
+		emit stopping JOB=network
 		rm -f /var/lock/subsys/network >/dev/null 2>&1
 		emit pld.network-stopped
+		emit --no-wait stopped JOB=network
 		exit 0
 	fi
 	stop


More information about the pld-cvs-commit mailing list