Merge lp:~vorlon/upstart/debian-bug-659540 into lp:upstart

Proposed by Steve Langasek
Status: Merged
Merged at revision: 1379
Proposed branch: lp:~vorlon/upstart/debian-bug-659540
Merge into: lp:upstart
Diff against target: 34 lines (+14/-2)
1 file modified
util/shutdown.c (+14/-2)
To merge this branch: bzr merge lp:~vorlon/upstart/debian-bug-659540
Reviewer Review Type Date Requested Status
James Hunt Approve
Review via email: mp+122349@code.launchpad.net

Description of the change

Self-explanatory fix for compatibilty with the new initctl path used by
sysvinit in Debian wheezy.

To post a comment you must log in.
Revision history for this message
James Hunt (jamesodhunt) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'util/shutdown.c'
2--- util/shutdown.c 2010-12-20 09:46:30 +0000
3+++ util/shutdown.c 2012-08-31 19:46:19 +0000
4@@ -80,6 +80,14 @@
5 #define DEV_INITCTL "/dev/initctl"
6 #endif
7
8+/**
9+ * RUN_INITCTL:
10+ *
11+ * System V init control socket (new location).
12+ **/
13+#ifndef RUN_INITCTL
14+#define RUN_INITCTL "/run/initctl"
15+#endif
16
17 /* Prototypes for option functions */
18 static int runlevel_option (NihOption *option, const char *arg);
19@@ -819,9 +827,13 @@
20 sigemptyset (&act.sa_mask);
21 sigaction (SIGALRM, &act, NULL);
22
23- /* Try and open /dev/initctl */
24 alarm (3);
25- fd = open (DEV_INITCTL, O_WRONLY | O_NDELAY | O_NOCTTY);
26+ /* Try and open /run/initctl */
27+ fd = open (RUN_INITCTL, O_WRONLY | O_NDELAY | O_NOCTTY);
28+ if (fd < 0) {
29+ /* Fall back to /dev/initctl */
30+ fd = open (DEV_INITCTL, O_WRONLY | O_NDELAY | O_NOCTTY);
31+ }
32 if (fd >= 0) {
33 if (write (fd, &request, sizeof (request)) == sizeof (request))
34 exit (0);

Subscribers

People subscribed via source and target branches