Merge authors:
  Steve Langasek (vorlon)
Related merge proposals:
  https://code.launchpad.net/~vorlon/upstart/debian-bug-659540/+merge/122349
  proposed by: Steve Langasek (vorlon)
  review: Approve - James Hunt (jamesodhunt)
------------------------------------------------------------
revno: 1379 [merge]
committer: James Hunt <[email protected]>
branch nick: upstart
timestamp: Mon 2012-09-03 08:38:15 +0100
message:
  Merge of lp:~vorlon/upstart/debian-bug-659540.
modified:
  util/shutdown.c


--
lp:upstart
https://code.launchpad.net/~upstart-devel/upstart/trunk

Your team Upstart Reviewers is subscribed to branch lp:upstart.
To unsubscribe from this branch go to 
https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'util/shutdown.c'
--- util/shutdown.c	2010-12-20 09:46:30 +0000
+++ util/shutdown.c	2012-08-31 18:20:27 +0000
@@ -80,6 +80,14 @@
 #define DEV_INITCTL "/dev/initctl"
 #endif
 
+/**
+ * RUN_INITCTL:
+ *
+ * System V init control socket (new location).
+ **/
+#ifndef RUN_INITCTL
+#define RUN_INITCTL "/run/initctl"
+#endif
 
 /* Prototypes for option functions */
 static int runlevel_option (NihOption *option, const char *arg);
@@ -819,9 +827,13 @@
 	sigemptyset (&act.sa_mask);
 	sigaction (SIGALRM, &act, NULL);
 
-	/* Try and open /dev/initctl */
 	alarm (3);
-	fd = open (DEV_INITCTL, O_WRONLY | O_NDELAY | O_NOCTTY);
+	/* Try and open /run/initctl */
+	fd = open (RUN_INITCTL, O_WRONLY | O_NDELAY | O_NOCTTY);
+	if (fd < 0) {
+		/* Fall back to /dev/initctl */
+		fd = open (DEV_INITCTL, O_WRONLY | O_NDELAY | O_NOCTTY);
+	}
 	if (fd >= 0) {
 		if (write (fd, &request, sizeof (request)) == sizeof (request))
 			exit (0);

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

Reply via email to