From 4b2ff53ec6972f159a9b0343aa6d533e346e0518 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 6 Nov 2009 21:17:11 +0000 Subject: [PATCH] * Don't stop jobs that are already stopped. svn path=/nixos/branches/upstart-0.6/; revision=18226 --- modules/system/upstart-events/shutdown.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/upstart-events/shutdown.nix b/modules/system/upstart-events/shutdown.nix index a8519edbd84..02bce7979d0 100644 --- a/modules/system/upstart-events/shutdown.nix +++ b/modules/system/upstart-events/shutdown.nix @@ -35,8 +35,8 @@ with pkgs.lib; # Stop all Upstart jobs. - initctl list | while read jobName rest; do - if test "$jobName" != shutdown; then + initctl list | while IFS=", " read jobName status rest; do + if test "$jobName" != shutdown -a "$status" != "stop/waiting"; then echo "stopping $jobName..." stop "$jobName" fi