[upstart] upstart-shutdown-exitcode.patch - exit shutdown with nonzero exitcode when fails shutdown
Petr Lautrbach
plautrba at fedoraproject.org
Tue Sep 21 11:40:36 UTC 2010
commit 6c8f335774a1e5b4903097e691034f64fe631fe1
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