wrappers: service start/stop were inconsistent #3321

Merged
merged 1 commit into from May 16, 2017

Conversation

Projects
None yet
3 participants
Member

chipaca commented May 15, 2017

service start and stop (and add/remove) were rather inconsistent in that start enabled, but remove disabled; add wrote the service files, but start called daemon-reload.

I've changed them so add/remove are the ones enabling/disabling, as well as calling daemon-reload (daemon-reload is only needed when a service file is changed), leaving start/stop to just start/stop.

Just a quick comment, trying to grok the rest

@@ -454,9 +454,14 @@ func (app *AppInfo) LauncherPostStopCommand() string {
return app.launcherCommand("--command=post-stop")
}
+// Servicename returns the systemd service name for the daemon app.
@zyga

zyga May 15, 2017

Contributor

Typo: s/Servicename/ServiceName/

@chipaca

chipaca May 15, 2017

Member

augh! ok to fix in a followup if the tests come up green?

@zyga

zyga May 15, 2017

Contributor

Yes, sure

@@ -454,9 +454,14 @@ func (app *AppInfo) LauncherPostStopCommand() string {
return app.launcherCommand("--command=post-stop")
}
+// Servicename returns the systemd service name for the daemon app.
+func (app *AppInfo) ServiceName() string {
@zyga

zyga May 15, 2017

Contributor

Thanks! :)

mvo5 approved these changes May 16, 2017

Thanks for making things more consistent.

// ServiceFile returns the systemd service file path for the daemon app.
func (app *AppInfo) ServiceFile() string {
- return filepath.Join(dirs.SnapServicesDir, app.SecurityTag()+".service")
+ return filepath.Join(dirs.SnapServicesDir, app.ServiceName())
@mvo5

mvo5 May 16, 2017

Collaborator

❤️

zyga approved these changes May 16, 2017

LGTM

@zyga zyga merged commit 5333850 into snapcore:master May 16, 2017

7 checks passed

artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details

@chipaca chipaca deleted the chipaca:wrappers-service-reshuffle branch May 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment