Merge lp:~stgraber/upstart/upstart-make-event-bridge-usable into lp:upstart
Status: | Merged |
---|---|
Merged at revision: | 1430 |
Proposed branch: | lp:~stgraber/upstart/upstart-make-event-bridge-usable |
Merge into: | lp:upstart |
Diff against target: |
168 lines (+58/-17) 2 files modified
extra/conf/upstart-event-bridge.conf (+1/-2) extra/upstart-event-bridge.c (+57/-15) |
To merge this branch: | bzr merge lp:~stgraber/upstart/upstart-make-event-bridge-usable |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Hunt | Approve | ||
Review via email: mp+144399@code.launchpad.net |
Description of the change
This branch addresses a few problems with the current implementation of the
event bridge.
== PID file handling ==
In the past, when started with --daemon, nih would try to create a pidfile
under /run, which would obviously fail when running as a user.
The first change is to instead use XDG_RUNTIME_DIR or HOME as the preferred
location for the pidfile.
This brings us to the second problem with the pidfile. A single user may have
multiple upstart instances running at the same time, each of those would
require its own event bridge. So the pidfile can't be unique to the user.
This one was fixed in two ways:
- upstart-
will be created at all.
- When called with --daemon, the pidfile now includes the PID of the upstart
instance, taken from the value of UPSTART_SESSION (last field).
== DBus socket ==
When the event bridge was initially written, we didn't have a private socket
for the user instance, so the bridge was connecting to the DBus session bus.
However, we know have that private socket and no longer use the session bus by
default.
So this branch now changes the default bus from the session bus to the upstart
user session private bus.
* extra/upstart- event-bridge. c: main():
- Looks like user_session_path should be nih_local, whilst path_element should just be 'char *'?
- If $HOME is not set, we fail to start. That's probably reasonable though as we display a couple
of errors in that scenario.