Merge lp:~aacid/policykit-unity8/no_crash_already_running into lp:policykit-unity8

Proposed by Albert Astals Cid
Status: Rejected
Rejected by: Albert Astals Cid
Proposed branch: lp:~aacid/policykit-unity8/no_crash_already_running
Merge into: lp:policykit-unity8
Diff against target: 20 lines (+6/-2)
1 file modified
service/main.cpp (+6/-2)
To merge this branch: bzr merge lp:~aacid/policykit-unity8/no_crash_already_running
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Disapprove
Ted Gould (community) Approve
unity-api-1-bot continuous-integration Approve
Review via email: mp+309444@code.launchpad.net

Commit message

Don't crash if there's already one agent running

Just exit with error

Description of the change

No need to get apport to show up just because the app was already running and failed to start

To post a comment you must log in.
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:15
https://jenkins.canonical.com/unity-api-1/job/lp-policykit-unity8-ci/8/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/912
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/919
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/722
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/722/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/722
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/722/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/722
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/722/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/722
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/722/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/722
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/722/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/722
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/722/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/722
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/722/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/722
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/722/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/722
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/722/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-policykit-unity8-ci/8/rebuild

review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) :
review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

Code looks nice, but for some reason it makes this thing stop workign altogether i.e. "pkexec ls" gives you a command line prompt instead a snap decision, so i'll reject this.

review: Disapprove

Unmerged revisions

15. By Albert Astals Cid

Don't crash if there's already one agent running

Just exit with error

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'service/main.cpp'
2--- service/main.cpp 2016-04-09 13:48:52 +0000
3+++ service/main.cpp 2016-10-27 08:30:09 +0000
4@@ -31,10 +31,14 @@
5 int main(int argc, char* argv[])
6 {
7 auto auths = std::make_shared<AuthManager>();
8- auto agent = std::make_shared<Agent>(auths);
9+ try {
10+ auto agent = std::make_shared<Agent>(auths);
11+ g_debug("PolicyKit Agent Started");
12+ } catch (const std::runtime_error &e) {
13+ retval.set_value(-1);
14+ }
15
16 std::signal(SIGTERM, [](int signal) -> void { retval.set_value(0); });
17
18- g_debug("PolicyKit Agent Started");
19 return retval.get_future().get();
20 }

Subscribers

People subscribed via source and target branches