Merge lp:~jamesodhunt/snappy/service-files-should-not-be-executable into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by James Hunt
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 304
Merged at revision: 307
Proposed branch: lp:~jamesodhunt/snappy/service-files-should-not-be-executable
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 27 lines (+5/-1)
2 files modified
snappy/click.go (+1/-1)
snappy/click_test.go (+4/-0)
To merge this branch: bzr merge lp:~jamesodhunt/snappy/service-files-should-not-be-executable
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve
Review via email: mp+254873@code.launchpad.net

Commit message

Fix permissions of auto-generated .service files.

Description of the change

The generated systemd .service files are executable and should not be (they are configuration files). Systemd complains via syslog:

Apr 1 07:39:23 localhost systemd[1]: Configuration file /etc/systemd/system/webdm_snappyd_0.1.service is marked executable. Please remove executable permission bits. Proceeding anyway.

This branch changes the perms from 0755 to 0644.

To post a comment you must log in.
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy/click.go'
2--- snappy/click.go 2015-04-01 03:11:44 +0000
3+++ snappy/click.go 2015-04-01 08:04:48 +0000
4@@ -493,7 +493,7 @@
5 content := generateSnapServicesFile(service, realBaseDir, aaProfile, m)
6 serviceFilename := generateServiceFileName(m, service)
7 helpers.EnsureDir(filepath.Dir(serviceFilename), 0755)
8- if err := ioutil.WriteFile(serviceFilename, []byte(content), 0755); err != nil {
9+ if err := ioutil.WriteFile(serviceFilename, []byte(content), 0644); err != nil {
10 return err
11 }
12
13
14=== modified file 'snappy/click_test.go'
15--- snappy/click_test.go 2015-04-01 03:11:44 +0000
16+++ snappy/click_test.go 2015-04-01 08:04:48 +0000
17@@ -628,6 +628,10 @@
18
19 servicesFile := filepath.Join(snapServicesDir, "foo.mvo_service_1.0.service")
20 c.Assert(helpers.FileExists(servicesFile), Equals, true)
21+ st, err := os.Stat(servicesFile)
22+ c.Assert(err, IsNil)
23+ // should _not_ be executable
24+ c.Assert(st.Mode().String(), Equals, "-rw-r--r--")
25
26 // and that it gets removed on remove
27 snapDir := filepath.Join(snapAppsDir, "foo.mvo", "1.0")

Subscribers

People subscribed via source and target branches