snap set refresh.hold immediately triggers a refresh when set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Confirmed
|
Medium
|
Unassigned |
Bug Description
When launching a fresh multipass Ubuntu Core VM for a demo, it's desirable to turn off refreshes so that your demo doesn't get interrupted by a refresh during the demo. However the documented way to do this, by setting refresh.hold, actually seems to trigger a refresh!
See:
$ multipass launch core
Launched: achieving-stork
$ multipass shell achieving-stork
Welcome to Ubuntu Core 16 (GNU/Linux 4.4.0-157-generic x86_64)
* Ubuntu Core: https:/
* Community: https:/
* Snaps: https:/
This Ubuntu Core machine is a tiny, transactional edition of Ubuntu,
designed for appliances, firmware and fixed-function VMs.
If all the software you care about is available as snaps, you are in
the right place. If not, you will be more comfortable with classic
deb-based Ubuntu Server or Desktop, where you can mix snaps with
traditional debs. It's a brave new world here in Ubuntu Core!
Please see 'snap --help' for app installation and updates.
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@
ID Status Spawn Ready Summary
1 Done today at 15:29 UTC today at 15:30 UTC Initialize system state
2 Done today at 15:30 UTC today at 15:30 UTC Initialize device
ubuntu@
Name Version Rev Tracking Publisher Notes
core 16-2.39.3 7270 stable canonical✓ core
pc 16.04-0.10 33 stable canonical✓ gadget
pc-kernel 4.4.0-157.185 258 stable canonical✓ kernel
ubuntu@
ubuntu@
ID Status Spawn Ready Summary
1 Done today at 15:29 UTC today at 15:30 UTC Initialize system state
2 Done today at 15:30 UTC today at 15:30 UTC Initialize device
3 Done today at 15:30 UTC today at 15:30 UTC Change configuration of "core" snap
4 Doing today at 15:30 UTC - Auto-refresh snaps "core", "pc-kernel"
```
The same thing happens on UC18 as well, albeit with a different set of snaps obviously, core18, snapd and pc-kernel.
Changed in snapd: | |
importance: | High → Medium |
Looks like it's a specific scenario for the core devices. I believe this happens:
- system seeding completes
- there's no previous refresh, so it falls back to the mod time of either the core snap or the snapd executable
- ensure loop runs every 5 minutes, so if that happens first the system will auto refresh
- calling `snap set system refresh.hold=..` triggers EnsureBefore(0), so it actually speeds up the auto refresh
In comparison, in cloud images, snapd automatically sets up refresh.hold=now+2h after seeding completes. Perhaps it's something we should do for newly seeded core images too. Some input from Mvo or Samuele would be useful here.