Hello,

reboot/shutdown should exit with non-zero exit code if shutdown process fail.

Now when system is booted without upstart or sysvinit, e.g. with 
init=/bin/bash, reboot/shutdown just exits
with 0 and nothing happens.

Regards,

Petr Lautrbach
--
Petr Lautrbach, Red Hat, Inc.
=== modified file 'util/shutdown.c'
--- util/shutdown.c     2010-02-04 08:33:40 +0000
+++ util/shutdown.c     2010-07-14 15:16:32 +0000
@@ -459,6 +459,7 @@
 {
        nih_local char **extra_env = NULL;
        NihDBusError *   dbus_err;
+       int              exit_val = 0;
 
        if (init_halt) {
                char *e;
@@ -486,12 +487,14 @@
                 * yet rebooted ... so try /dev/initctl
                 */
                sysvinit_shutdown ();
+               nih_fatal ("Unable to shutdown system");
+               exit_val = 1;
        }
 
        unlink (ETC_NOLOGIN);
        nih_main_unlink_pidfile ();
 
-       exit (0);
+       exit (exit_val);
 }
 
 /**

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to