Merge lp:~rafalcieslak256/ubuntu-accomplishments-daemon/daemon-launcher into lp:ubuntu-accomplishments-daemon
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 125 | ||||
Proposed branch: | lp:~rafalcieslak256/ubuntu-accomplishments-daemon/daemon-launcher | ||||
Merge into: | lp:ubuntu-accomplishments-daemon | ||||
Diff against target: |
310 lines (+164/-78) 4 files modified
accomplishments/daemon/api.py (+9/-1) accomplishments/daemon/dbusapi.py (+10/-5) bin/accomplishments-daemon (+145/-34) bin/accomplishments-daemon-fg (+0/-38) |
||||
To merge this branch: | bzr merge lp:~rafalcieslak256/ubuntu-accomplishments-daemon/daemon-launcher | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matt Fischer | Approve | ||
Review via email: mp+118344@code.launchpad.net |
Description of the change
This implements an elegant launcher for the accomplishments daemon. It is launcher by executing `accomplishment
Supported options include:
* --help - Guess what it does.
* --start - Launches the daemon. If the launcher is run without arguments, it behaves just as if with --start.
* --stop - Calls stop_daemon() via DBUsAPI, which stops the rector. A graceful way to exit the daemon.
* --kill - Kills the daemon process (by PID).
* --reload - Reloads accomplishments database. It will also send a DBus signal, but note that the viewer does not support it yet, and it will require restart to get the new accomplishments from daemon.
Note that the viewer is not yet aware of the launcher and runs the daemon 'the old way'. It may slightly confuse the launcher (it will be able to stop a daemon which was started by viewer, but won't be able to kill it, as it does not know where to find the PID file). I don't think there is a point in a separate branch for this fix in viewer, as it's gonna be a 1 line change, therefore simply avoid starting the daemon with viewer when testing this branch (run the daemon manually and then the viewer) and I will apply the fix to the viewer when this branch gets merged in.
And remember to restart the daemon before testing this branch ;-)
I think this is a great solution and will be clean even when run as different users since dbus is per session. Two minor comments and a question:
typo on line 19: "stop_daemo"
minor issue, line 86: "if the path is set wrongly" change "wrongly" to "incorrectly" as wrongly isn't a valid word ;)
Did you run the unit tests in a pbuilder environment with this change yet? If not, I can try it later today. I'm worried about package changes mainly if there needs to be any, since the daemon doesn't run anyway.