Merge lp:~ted/indicator-power/systemd-unit into lp:indicator-power

Proposed by Ted Gould on 2016-07-19
Status: Merged
Approved by: Martin Pitt on 2016-10-21
Approved revision: 299
Merged at revision: 298
Proposed branch: lp:~ted/indicator-power/systemd-unit
Merge into: lp:indicator-power
Diff against target: 82 lines (+44/-0)
4 files modified
data/CMakeLists.txt (+32/-0)
data/indicator-power.override (+1/-0)
data/indicator-power.service.in (+8/-0)
debian/control (+3/-0)
To merge this branch: bzr merge lp:~ted/indicator-power/systemd-unit
Reviewer Review Type Date Requested Status
Martin Pitt 2016-07-19 Approve on 2016-10-21
unity-api-1-bot continuous-integration Approve on 2016-09-12
PS Jenkins bot continuous-integration Pending
Review via email: mp+300444@code.launchpad.net

Commit message

Add systemd user session unit file

Description of the change

WE HAVE THE POWER!

To post a comment you must log in.
lp:~ted/indicator-power/systemd-unit updated on 2016-07-20
299. By Ted Gould on 2016-07-20

Adding a restart rule

unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:299
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-power-ci/1/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/609
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/615
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/438
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/438/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/438
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/438/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/438
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/438/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/438
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/438/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/438
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/438/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/438
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/438/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/438
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/438/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/438
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/438/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/438
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/438/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Martin Pitt (pitti) wrote :

LGTM and works fine, thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/CMakeLists.txt'
2--- data/CMakeLists.txt 2016-01-02 01:25:16 +0000
3+++ data/CMakeLists.txt 2016-07-20 06:58:52 +0000
4@@ -15,6 +15,38 @@
5 add_schema (${SCHEMA_FILE})
6
7 ##
8+## Systemd Unit File
9+##
10+
11+# where to install
12+# Uncomment when we drop Vivid
13+# pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)
14+set (SYSTEMD_USER_DIR "/usr/lib/systemd/user")
15+message (STATUS "${SYSTEMD_USER_DIR} is the systemd user unit file install dir")
16+
17+set (SYSTEMD_USER_NAME "${CMAKE_PROJECT_NAME}.service")
18+set (SYSTEMD_USER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SYSTEMD_USER_NAME}")
19+set (SYSTEMD_USER_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMD_USER_NAME}.in")
20+
21+# build it
22+set (pkglibexecdir "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}")
23+configure_file ("${SYSTEMD_USER_FILE_IN}" "${SYSTEMD_USER_FILE}")
24+
25+# install it
26+install (FILES "${SYSTEMD_USER_FILE}"
27+ DESTINATION "${SYSTEMD_USER_DIR}")
28+
29+##
30+## Upstart systemd override Job File
31+##
32+
33+set (UPSTART_SYSTEMD_OVERRIDE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/upstart/systemd-session/upstart")
34+message (STATUS "${UPSTART_SYSTEMD_OVERRIDE_DIR} is the Upstart override Job File for systemd dir")
35+
36+install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.override"
37+ DESTINATION "${UPSTART_SYSTEMD_OVERRIDE_DIR}")
38+
39+##
40 ## Upstart Job File
41 ##
42
43
44=== added file 'data/indicator-power.override'
45--- data/indicator-power.override 1970-01-01 00:00:00 +0000
46+++ data/indicator-power.override 2016-07-20 06:58:52 +0000
47@@ -0,0 +1,1 @@
48+manual
49
50=== added file 'data/indicator-power.service.in'
51--- data/indicator-power.service.in 1970-01-01 00:00:00 +0000
52+++ data/indicator-power.service.in 2016-07-20 06:58:52 +0000
53@@ -0,0 +1,8 @@
54+[Unit]
55+Description=Indicator Power
56+PartOf=graphical-session.target
57+After=indicators-pre.target
58+
59+[Service]
60+ExecStart=@pkglibexecdir@/indicator-power-service
61+Restart=on-failure
62
63=== modified file 'debian/control'
64--- debian/control 2016-05-16 18:09:57 +0000
65+++ debian/control 2016-07-20 06:58:52 +0000
66@@ -19,6 +19,8 @@
67 python3-dbusmock,
68 dbus-test-runner,
69 libdbustest1-dev,
70+# for systemd unit
71+ systemd,
72 Standards-Version: 3.9.5
73 Homepage: https://launchpad.net/indicator-power
74 # If you aren't a member of ~indicator-applet-developers but need to upload
75@@ -31,6 +33,7 @@
76 Architecture: any
77 Depends: ${shlibs:Depends},
78 ${misc:Depends},
79+ indicator-common,
80 upower,
81 Recommends: unity-control-center | gnome-control-center (>= 3.1) | ubuntu-system-settings | switchboard-plug-power | xfce4-power-manager | mate-power-manager,
82 indicator-applet (>= 0.2) | indicator-renderer,

Subscribers

People subscribed via source and target branches