Merge lp:~ted/upstart/obj-path into lp:upstart

Proposed by Ted Gould
Status: Merged
Approved by: Steve Langasek
Approved revision: 1528
Merged at revision: 1527
Proposed branch: lp:~ted/upstart/obj-path
Merge into: lp:upstart
Diff against target: 33 lines (+3/-3)
2 files modified
extra/man/dbus-event.7 (+2/-2)
extra/upstart-dbus-bridge.c (+1/-1)
To merge this branch: bzr merge lp:~ted/upstart/obj-path
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+183259@code.launchpad.net

Commit message

Change dbus object path from PATH to OBJPATH

Description of the change

With dbus events one of the environment variables is PATH. Which makes sense as it is the path to the object emitting the signal. But, unfortunately it overrides the perhaps more common use of PATH, to say where to find binaries. This makes it very hard to have scripts in a job that is listening on dbus events. I'm suggesting we change it to OBJPATH. While I realize this is an interface change, I think that it might effect few enough people, and all of them will like it, that it would be worth it.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

Obviously correct that we should not be overriding the special variable name "PATH" with something here. This breaks compatibility, but the current behavior is sufficiently wrong that I don't think we need to worry about preserving compatibility.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'extra/man/dbus-event.7'
--- extra/man/dbus-event.7 2013-07-24 09:22:25 +0000
+++ extra/man/dbus-event.7 2013-08-30 19:37:14 +0000
@@ -8,7 +8,7 @@
8.BI [ "" BUS\fR= BUS_NAME ]8.BI [ "" BUS\fR= BUS_NAME ]
9.BI SIGNAL\fR= SIGNAL9.BI SIGNAL\fR= SIGNAL
10.BI INTERFACE\fR= INTERFACE10.BI INTERFACE\fR= INTERFACE
11.BI PATH\fR= PATH11.BI OBJPATH\fR= PATH
12.BI SENDER\fR= SENDER12.BI SENDER\fR= SENDER
13.BI DESTINATION\fR= DESTINATION13.BI DESTINATION\fR= DESTINATION
14.BI ARG0\fR= VALUE14.BI ARG0\fR= VALUE
@@ -43,7 +43,7 @@
43.\"43.\"
44.SH EXAMPLES44.SH EXAMPLES
45.\"45.\"
46.IP "start on dbus SIGNAL=NameAcquired INTERFACE=org.freedesktop.DBus PATH=/org/freedesktop/DBus SENDER=org.freedesktop.DBus ARG0=com.mycorp.foo"46.IP "start on dbus SIGNAL=NameAcquired INTERFACE=org.freedesktop.DBus OBJPATH=/org/freedesktop/DBus SENDER=org.freedesktop.DBus ARG0=com.mycorp.foo"
47Start job when a particular47Start job when a particular
48.I NameAcquired48.I NameAcquired
49D-Bus signal is received.49D-Bus signal is received.
5050
=== modified file 'extra/upstart-dbus-bridge.c'
--- extra/upstart-dbus-bridge.c 2013-07-24 09:40:15 +0000
+++ extra/upstart-dbus-bridge.c 2013-08-30 19:37:14 +0000
@@ -513,7 +513,7 @@
513513
514 if (path) {514 if (path) {
515 nih_local char *var = NULL;515 nih_local char *var = NULL;
516 var = NIH_MUST (nih_sprintf (NULL, "PATH=%s", path));516 var = NIH_MUST (nih_sprintf (NULL, "OBJPATH=%s", path));
517 NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var));517 NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var));
518 }518 }
519519

Subscribers

People subscribed via source and target branches