From 60e464627b1db3def07543df31af2e5e09ce9b3e Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 10 Mar 2008 23:23:55 -0400 Subject: Add some minor upstart event notification for sysv scripts. (#431231) --- rc.d/rc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rc.d/rc b/rc.d/rc index 7f44b447..316751a4 100755 --- a/rc.d/rc +++ b/rc.d/rc @@ -37,7 +37,8 @@ do_confirm="no" if [ -f /var/run/confirm ]; then do_confirm="yes" fi - +UPSTART= +[ -x /sbin/initctl ] && UPSTART=yes # See if we want to be in user confirmation mode if [ "$previous" = "N" ]; then if [ "$do_confirm" = "yes" ]; then @@ -70,7 +71,9 @@ for i in /etc/rc$runlevel.d/K* ; do check_runlevel "$i" || continue # Bring the subsystem down. + [ -n "$UPSTART" ] && initctl emit --quiet "stopping $subsys" $i stop + [ -n "$UPSTART" ] && initctl emit --quiet "stopped $subsys" done # Now run the START scripts. @@ -97,11 +100,13 @@ for i in /etc/rc$runlevel.d/S* ; do update_boot_stage "$subsys" # Bring the subsystem up. + [ -n "$UPSTART" ] && initctl emit --quiet "starting $subsys" if [ "$subsys" = "halt" -o "$subsys" = "reboot" ]; then export LC_ALL=C exec $i start fi $i start + [ -n "$UPSTART" ] && initctl emit --quiet "started $subsys" done [ "$do_confirm" = "yes" ] && rm -f /var/run/confirm if [ "$GRAPHICAL" = "yes" ]; then -- cgit v1.2.1