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

debian: fix snapd.refresh.service install and usage #1270

Merged
merged 3 commits into from
Jun 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions debian/snapd.install
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ etc/ld.so.conf.d
# systemd stuff

# auto-update
debian/*.timer /lib/systemd/system/
debian/snappy-autopilot.service /lib/systemd/system/
debian/snapd.refresh.timer /lib/systemd/system/
debian/snapd.refresh.service /lib/systemd/system/
# snapd
debian/*.socket /lib/systemd/system/
debian/snapd.service /lib/systemd/system/
Expand Down
5 changes: 3 additions & 2 deletions debian/snapd.refresh.service
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[Unit]
Description=Automatically refresh installed snaps
After=network.target
Documentation=man:snap(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice touch, thank you


[Service]
Type=simple
# FIXME: add auto-reboot on devices
[Service]
Type=oneshot
ExecStart=/usr/bin/snap refresh
8 changes: 0 additions & 8 deletions debian/snappy-autopilot.service

This file was deleted.

12 changes: 0 additions & 12 deletions debian/snappy-autopilot.timer

This file was deleted.

6 changes: 3 additions & 3 deletions docs/autoupdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ fly themselves); the `systemd` units still use this name.
For more details of when it is to be triggered you could dig into the
implementation, via

systemctl list-timers snappy-autopilot.timer
systemctl list-timers snapd.refresh.timer

To check whether the update ran, run

systemctl status -l snappy-autopilot.service
systemctl status -l snapd.refresh.service

and to view any output from the command run

sudo journalctl -u snappy-autopilot.service
sudo journalctl -u snapd.refresh.service
11 changes: 9 additions & 2 deletions integration-tests/tests/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"github.com/snapcore/snapd/integration-tests/testutils/report"
"github.com/snapcore/snapd/integration-tests/testutils/runner"
"github.com/snapcore/snapd/integration-tests/testutils/wait"
"github.com/snapcore/snapd/osutil"
)

const (
Expand All @@ -53,8 +54,14 @@ func init() {
wait.ForFunction(c, "regular", partition.Mode)

if _, err := os.Stat(config.DefaultFileName); err == nil {
cli.ExecCommand(c, "sudo", "systemctl", "stop", "snappy-autopilot.timer")
cli.ExecCommand(c, "sudo", "systemctl", "disable", "snappy-autopilot.timer")
timerName := "snapd.refresh.timer"
// FIXME: compat with old os images, kill once we have released
// a stable OS snap with snapd 2.0.7
if osutil.FileExists("/lib/systemd/system/snappy-autopilot.service") {
timerName = "snappy-autopilot.timer"
}
cli.ExecCommand(c, "sudo", "systemctl", "stop", timerName)
cli.ExecCommand(c, "sudo", "systemctl", "disable", timerName)

cfg, err := config.ReadConfig(config.DefaultFileName)
c.Assert(err, check.IsNil, check.Commentf("Error reading config: %v", err))
Expand Down