[upstart/f14/master] upstart-shutdown-exitcode.patch - exit shutdown with nonzero exitcode when fails shutdown

Petr Lautrbach plautrba at fedoraproject.org
Tue Sep 21 12:10:54 UTC 2010


commit 703b9844e35d35c010dfa56c430861f019791f07
Author: Petr Lautrbach <plautrba at redhat.com>
Date:   Tue Sep 21 13:20:19 2010 +0200

    upstart-shutdown-exitcode.patch - exit shutdown with nonzero exitcode when fails shutdown

 upstart-shutdown-exitcode.patch |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/upstart-shutdown-exitcode.patch b/upstart-shutdown-exitcode.patch
new file mode 100644
index 0000000..0b70308
--- /dev/null
+++ b/upstart-shutdown-exitcode.patch
@@ -0,0 +1,28 @@
+diff --git a/util/shutdown.c b/util/shutdown.c
+index 0a6d8bf..2ef847a 100644
+--- a/util/shutdown.c
++++ b/util/shutdown.c
+@@ -459,6 +459,7 @@ shutdown_now (void)
+ {
+ 	nih_local char **extra_env = NULL;
+ 	NihDBusError *   dbus_err;
++	int exit_val = 0;
+ 
+ 	if (init_halt) {
+ 		char *e;
+@@ -486,12 +487,14 @@ shutdown_now (void)
+ 		 * 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);
+ }
+ 
+ /**


More information about the scm-commits mailing list