Merge lp:~mterry/snappy/systemd-restart-15.04 into lp:~snappy-dev/snappy/15.04-deprecated

Proposed by Michael Terry
Status: Merged
Approved by: Ricardo Salveti
Approved revision: 453
Merged at revision: 456
Proposed branch: lp:~mterry/snappy/systemd-restart-15.04
Merge into: lp:~snappy-dev/snappy/15.04-deprecated
Diff against target: 35 lines (+3/-0)
3 files modified
snappy/click_test.go (+1/-0)
systemd/systemd.go (+1/-0)
systemd/systemd_test.go (+1/-0)
To merge this branch: bzr merge lp:~mterry/snappy/systemd-restart-15.04
Reviewer Review Type Date Requested Status
Ricardo Salveti (community) Approve
Review via email: mp+263915@code.launchpad.net

Commit message

Restart systemd services on failure by default

This is a backport of r492 from trunk.

Description of the change

Set all app services to restart on failure.

See http://www.freedesktop.org/software/systemd/man/systemd.service.html for how systemd treats Restart=on-failure.

This is a backport of r492 from trunk.

To post a comment you must log in.
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Looks good, thanks!

review: Approve
Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :
Download full text (6.8 KiB)

The attempt to merge lp:~mterry/snappy/systemd-restart-15.04 into lp:snappy/15.04 failed. Below is the output from the failed tests.

Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update code.google.com/p/go.crypto failed; trying to fetch newer version
update github.com/blakesmith/ar failed; trying to fetch newer version
code.google.com/p/go.crypto now at 69e2a90ed92d03812364aeb947b7068dc42e561e
update github.com/cheggaaa/pb failed; trying to fetch newer version
github.com/blakesmith/ar now at c9a977dd0cc1392b023382c7bfa5a22af8d3b730
update github.com/jessevdk/go-flags failed; trying to fetch newer version
github.com/cheggaaa/pb now at e8c7cc515bfde3e267957a3b110080ceed51354e
update github.com/juju/loggo failed; trying to fetch newer version
github.com/jessevdk/go-flags now at 15347ef417a300349807983f15af9e65cd2e1b3a
update github.com/mvo5/goconfigparser failed; trying to fetch newer version
github.com/juju/loggo now at 4c7cbce140ca070eeb59a28f4bf9507e511711f9
update gopkg.in/yaml.v2 failed; trying to fetch newer version
github.com/mvo5/goconfigparser now at 26426272dda20cc76aa1fa44286dc743d2972fe8
update launchpad.net/gocheck failed; trying to fetch newer version
gopkg.in/yaml.v2 now at 49c95bdc21843256fb6c4e0d370a05f24a0bf213
launchpad.net/gocheck now at <email address hidden>
Building
Running tests from /home/tarmac/tmp/tmp.mz0bcXNGo4/src/launchpad.net/snappy
=== RUN Test
OK: 10 passed
--- PASS: Test (0.34 seconds)
PASS
coverage: 79.3% of statements
ok launchpad.net/snappy/clickdeb 0.346s coverage: 79.3% of statements
=== RUN Test
OK: 6 passed
--- PASS: Test (0.01 seconds)
PASS
coverage: 12.7% of statements
ok launchpad.net/snappy/cmd/snappy 0.019s coverage: 12.7% of statements
=== RUN Test
OK: 24 passed
--- PASS: Test (0.08 seconds)
PASS
coverage: 100.0% of statements
ok launchpad.net/snappy/coreconfig 0.087s coverage: 100.0% of statements
=== RUN Test
OK: 33 passed
--- PASS: Test (1.69 seconds)
PASS
coverage: 74.0% of statements
ok launchpad.net/snappy/helpers 1.697s coverage: 74.0% of statements
=== RUN Test
OK: 7 passed
--- PASS: Test (0.05 seconds)
PASS
coverage: 92.5% of statements
ok launchpad.net/snappy/logger 0.063s coverage: 92.5% of statements
=== RUN Test
OK: 38 passed
--- PASS: Test (0.18 seconds)
PASS
coverage: 82.2% of statements
ok launchpad.net/snappy/partition 0.190s coverage: 82.2% of statements
=== RUN Test
OK: 12 passed
--- PASS: Test (0.09 seconds)
PASS
coverage: 87.8% of statements
ok launchpad.net/snappy/policy 0.094s coverage: 87.8% of statements
=== RUN Test
OK: 3 passed
--- PASS: Test (0.00 seconds)
PASS
coverage: 84.8% of statements
ok launchpad.net/snappy/priv 0.005s coverage: 84.8% of statements
=== RUN Test
OK: 4 passed
--- PASS: Test (0.01 seconds)
PASS
coverage: 50.0% of statements
ok launchpad.net/snappy/progress 0.009s coverage: 50.0% of statements
=== RUN Test
OK: 6 passed
--- PASS: Test (0.01 seconds)
PASS
coverage: 100.0% of statements
ok launchpad.net/snappy/release 0.010s coverage: 100.0% of statements
=== RUN Test
2015-07-06 18:43:42 ERROR snappy logger.go:199 hello-app.potato failed to install: a package by that name is...

Read more...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy/click_test.go'
2--- snappy/click_test.go 2015-06-03 19:34:38 +0000
3+++ snappy/click_test.go 2015-07-06 15:34:31 +0000
4@@ -1189,6 +1189,7 @@
5
6 [Service]
7 ExecStart=/usr/bin/ubuntu-core-launcher xkcd-webserver%s xkcd-webserver%[2]s_xkcd-webserver_0.3.4 /apps/xkcd-webserver%[2]s/0.3.4/bin/foo start
8+Restart=on-failure
9 WorkingDirectory=/apps/xkcd-webserver%[2]s/0.3.4/
10 Environment="SNAP_APP=xkcd-webserver_xkcd-webserver_0.3.4" "TMPDIR=/tmp/snaps/xkcd-webserver%[2]s/0.3.4/tmp" "TEMPDIR=/tmp/snaps/xkcd-webserver%[2]s/0.3.4/tmp" "SNAP_APP_PATH=/apps/xkcd-webserver%[2]s/0.3.4/" "SNAP_APP_DATA_PATH=/var/lib/apps/xkcd-webserver%[2]s/0.3.4/" "SNAP_APP_TMPDIR=/tmp/snaps/xkcd-webserver%[2]s/0.3.4/tmp" "SNAP_NAME=xkcd-webserver" "SNAP_VERSION=0.3.4" "SNAP_ORIGIN=%[3]s" "SNAP_FULLNAME=xkcd-webserver%[2]s" "SNAP_ARCH=%[5]s" "SNAP_APP_USER_DATA_PATH=%%h/apps/xkcd-webserver%[2]s/0.3.4/" "SNAPP_APP_PATH=/apps/xkcd-webserver%[2]s/0.3.4/" "SNAPP_APP_DATA_PATH=/var/lib/apps/xkcd-webserver%[2]s/0.3.4/" "SNAPP_APP_TMPDIR=/tmp/snaps/xkcd-webserver%[2]s/0.3.4/tmp" "SNAPPY_APP_ARCH=%[5]s" "SNAPP_APP_USER_DATA_PATH=%%h/apps/xkcd-webserver%[2]s/0.3.4/"
11 ExecStop=/usr/bin/ubuntu-core-launcher xkcd-webserver%[2]s xkcd-webserver%[2]s_xkcd-webserver_0.3.4 /apps/xkcd-webserver%[2]s/0.3.4/bin/foo stop
12
13=== modified file 'systemd/systemd.go'
14--- systemd/systemd.go 2015-06-03 19:34:38 +0000
15+++ systemd/systemd.go 2015-07-06 15:34:31 +0000
16@@ -179,6 +179,7 @@
17
18 [Service]
19 ExecStart=/usr/bin/ubuntu-core-launcher {{.UdevAppName}} {{.AaProfile}} {{.FullPathStart}}
20+Restart=on-failure
21 WorkingDirectory={{.AppPath}}
22 Environment="SNAP_APP={{.AppTriple}}" {{.EnvVars}}
23 {{if .Stop}}ExecStop=/usr/bin/ubuntu-core-launcher {{.UdevAppName}} {{.AaProfile}} {{.FullPathStop}}{{end}}
24
25=== modified file 'systemd/systemd_test.go'
26--- systemd/systemd_test.go 2015-06-03 19:34:38 +0000
27+++ systemd/systemd_test.go 2015-07-06 15:34:31 +0000
28@@ -153,6 +153,7 @@
29
30 [Service]
31 ExecStart=/usr/bin/ubuntu-core-launcher app%[2]s aa-profile /apps/app%[2]s/1.0/bin/start
32+Restart=on-failure
33 WorkingDirectory=/apps/app%[2]s/1.0/
34 Environment="SNAP_APP=app_service_1.0" "TMPDIR=/tmp/snaps/app%[2]s/1.0/tmp" "TEMPDIR=/tmp/snaps/app%[2]s/1.0/tmp" "SNAP_APP_PATH=/apps/app%[2]s/1.0/" "SNAP_APP_DATA_PATH=/var/lib/apps/app%[2]s/1.0/" "SNAP_APP_TMPDIR=/tmp/snaps/app%[2]s/1.0/tmp" "SNAP_NAME=app" "SNAP_VERSION=1.0" "SNAP_ORIGIN=%[3]s" "SNAP_FULLNAME=app%[2]s" "SNAP_ARCH=%[5]s" "SNAP_APP_USER_DATA_PATH=%%h/apps/app%[2]s/1.0/" "SNAPP_APP_PATH=/apps/app%[2]s/1.0/" "SNAPP_APP_DATA_PATH=/var/lib/apps/app%[2]s/1.0/" "SNAPP_APP_TMPDIR=/tmp/snaps/app%[2]s/1.0/tmp" "SNAPPY_APP_ARCH=%[5]s" "SNAPP_APP_USER_DATA_PATH=%%h/apps/app%[2]s/1.0/"
35 ExecStop=/usr/bin/ubuntu-core-launcher app%[2]s aa-profile /apps/app%[2]s/1.0/bin/stop

Subscribers

People subscribed via source and target branches