Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

many: implement "refresh-mode: {restart,endure,...}" for services #4617

Merged
merged 13 commits into from
Feb 19, 2018
Merged
Prev Previous commit
Next Next commit
add debug to identify test failure
  • Loading branch information
mvo5 committed Feb 14, 2018
commit d83ffe404af8bb26486dc6598bf8d13a073a3709
2 changes: 2 additions & 0 deletions wrappers/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ func AddSnapServices(s *snap.Info, inter interacter) (err error) {
func StopServices(apps []*snap.AppInfo, reason snap.ServiceStopReason, inter interacter) error {
sysd := systemd.New(dirs.GlobalRootDir, inter)

logger.Debugf("StopServices called for %q, reason: %v", apps, reason)
for _, app := range apps {
// Handle the case where service file doesn't exist and don't try to stop it as it will fail.
// This can happen with snap try when snap.yaml is modified on the fly and a daemon line is added.
Expand All @@ -227,6 +228,7 @@ func StopServices(apps []*snap.AppInfo, reason snap.ServiceStopReason, inter int
// Skip stop on refresh when refresh mode is set to something
// other than "restart" (or "" which is the same)
if reason == snap.StopReasonRefresh {
logger.Debugf(" %s refresh-mode: %v", app.Name, app.RefreshMode)
switch app.RefreshMode {
case "endure":
// skip this service
Expand Down