Ubuntu Core doesn't 'batch' reboots


#1

I have a laptop running Ubuntu Core, which hasn’t been booted for a few weeks. I booted it today, expecting some snap updates. Sure enough, as soon as it boots up the snaps start refreshing. A core update triggered a reboot. When the system came back online, another update triggered a reboot soon after.

Why don’t we batch those operations, rather than have multiple restarts in succession?

popey@localhost:~$ snap version
snap    2.35.4
snapd   2.35.4
series  16
kernel  4.4.0-138-generic

Note the restart at 10:27 (core update) and then again at 10:32 (kernel update)

popey@localhost:~$ last reboot
reboot   system boot  4.4.0-138-generi Fri Oct 26 10:36   still running
reboot   system boot  4.4.0-137-generi Fri Oct 26 10:32 - 10:36  (00:03)
reboot   system boot  4.4.0-137-generi Fri Oct 26 10:27 - 10:36  (00:08)
reboot   system boot  4.4.0-137-generi Tue Oct  9 08:46 - 10:36 (17+01:49)
popey@localhost:~$ snap changes
ID   Status  Spawn                      Ready                      Summary
251  Done    13 days ago, at 15:23 UTC  13 days ago, at 15:23 UTC  Refresh all snaps: no updates
252  Done    13 days ago, at 15:24 UTC  13 days ago, at 15:25 UTC  Install "wethr" snap
253  Done    13 days ago, at 15:26 UTC  13 days ago, at 15:26 UTC  Refresh "wethr" snap from "edge" channel
254  Done    13 days ago, at 15:51 UTC  13 days ago, at 15:51 UTC  Refresh "wethr" snap
255  Done    13 days ago, at 16:04 UTC  13 days ago, at 16:04 UTC  Refresh all snaps: no updates
256  Done    today at 10:30 UTC         today at 10:37 UTC         Refresh snaps "core", "pc-kernel", "get-iplayer", "lxd"
popey@localhost:~$ snap change 256
Status  Spawn               Ready               Summary
Done    today at 10:30 UTC  today at 10:30 UTC  Ensure prerequisites for "core" are available
Done    today at 10:30 UTC  today at 10:30 UTC  Download snap "core" (5662) from channel "stable"
Done    today at 10:30 UTC  today at 10:30 UTC  Fetch and check assertions for snap "core" (5662)
Done    today at 10:30 UTC  today at 10:30 UTC  Mount snap "core" (5662)
Done    today at 10:30 UTC  today at 10:30 UTC  Run pre-refresh hook of "core" snap if present
Done    today at 10:30 UTC  today at 10:30 UTC  Stop snap "core" services
Done    today at 10:30 UTC  today at 10:30 UTC  Remove aliases for snap "core"
Done    today at 10:30 UTC  today at 10:30 UTC  Make current revision for snap "core" unavailable
Done    today at 10:30 UTC  today at 10:30 UTC  Copy snap "core" data
Done    today at 10:30 UTC  today at 10:30 UTC  Setup snap "core" (5662) security profiles
Done    today at 10:30 UTC  today at 10:30 UTC  Make snap "core" (5662) available to the system
Done    today at 10:30 UTC  today at 10:34 UTC  Automatically connect eligible plugs and slots of snap "core"
Done    today at 10:30 UTC  today at 10:34 UTC  Set automatic aliases for snap "core"
Done    today at 10:30 UTC  today at 10:34 UTC  Setup snap "core" aliases
Done    today at 10:30 UTC  today at 10:34 UTC  Run post-refresh hook of "core" snap if present
Done    today at 10:30 UTC  today at 10:34 UTC  Start snap "core" (5662) services
Done    today at 10:30 UTC  today at 10:34 UTC  Remove data for snap "core" (5145)
Done    today at 10:30 UTC  today at 10:34 UTC  Remove snap "core" (5145) from the system
Done    today at 10:30 UTC  today at 10:34 UTC  Clean up "core" (5662) install
Done    today at 10:30 UTC  today at 10:34 UTC  Run configure hook of "core" snap if present
Done    today at 10:30 UTC  today at 10:34 UTC  Ensure prerequisites for "pc-kernel" are available
Done    today at 10:30 UTC  today at 10:34 UTC  Download snap "pc-kernel" (162) from channel "stable"
Done    today at 10:30 UTC  today at 10:34 UTC  Fetch and check assertions for snap "pc-kernel" (162)
Done    today at 10:30 UTC  today at 10:35 UTC  Mount snap "pc-kernel" (162)
Done    today at 10:30 UTC  today at 10:35 UTC  Run pre-refresh hook of "pc-kernel" snap if present
Done    today at 10:30 UTC  today at 10:35 UTC  Stop snap "pc-kernel" services
Done    today at 10:30 UTC  today at 10:35 UTC  Remove aliases for snap "pc-kernel"
Done    today at 10:30 UTC  today at 10:35 UTC  Make current revision for snap "pc-kernel" unavailable
Done    today at 10:30 UTC  today at 10:35 UTC  Copy snap "pc-kernel" data
Done    today at 10:30 UTC  today at 10:35 UTC  Setup snap "pc-kernel" (162) security profiles
Done    today at 10:30 UTC  today at 10:35 UTC  Make snap "pc-kernel" (162) available to the system
Done    today at 10:30 UTC  today at 10:36 UTC  Automatically connect eligible plugs and slots of snap "pc-kernel"
Done    today at 10:30 UTC  today at 10:36 UTC  Set automatic aliases for snap "pc-kernel"
Done    today at 10:30 UTC  today at 10:36 UTC  Setup snap "pc-kernel" aliases
Done    today at 10:30 UTC  today at 10:37 UTC  Run post-refresh hook of "pc-kernel" snap if present
Done    today at 10:30 UTC  today at 10:37 UTC  Start snap "pc-kernel" (162) services
Done    today at 10:30 UTC  today at 10:37 UTC  Remove data for snap "pc-kernel" (144)
Done    today at 10:30 UTC  today at 10:37 UTC  Remove snap "pc-kernel" (144) from the system
Done    today at 10:30 UTC  today at 10:37 UTC  Clean up "pc-kernel" (162) install
Done    today at 10:30 UTC  today at 10:37 UTC  Run configure hook of "pc-kernel" snap if present
Done    today at 10:30 UTC  today at 10:34 UTC  Ensure prerequisites for "get-iplayer" are available
Done    today at 10:30 UTC  today at 10:34 UTC  Download snap "get-iplayer" (73) from channel "stable"
Done    today at 10:30 UTC  today at 10:34 UTC  Fetch and check assertions for snap "get-iplayer" (73)
Done    today at 10:30 UTC  today at 10:34 UTC  Mount snap "get-iplayer" (73)
Done    today at 10:30 UTC  today at 10:34 UTC  Run pre-refresh hook of "get-iplayer" snap if present
Done    today at 10:30 UTC  today at 10:34 UTC  Stop snap "get-iplayer" services
Done    today at 10:30 UTC  today at 10:34 UTC  Remove aliases for snap "get-iplayer"
Done    today at 10:30 UTC  today at 10:34 UTC  Make current revision for snap "get-iplayer" unavailable
Done    today at 10:30 UTC  today at 10:34 UTC  Copy snap "get-iplayer" data
Done    today at 10:30 UTC  today at 10:34 UTC  Setup snap "get-iplayer" (73) security profiles
Done    today at 10:30 UTC  today at 10:34 UTC  Make snap "get-iplayer" (73) available to the system
Done    today at 10:30 UTC  today at 10:34 UTC  Automatically connect eligible plugs and slots of snap "get-iplayer"
Done    today at 10:30 UTC  today at 10:34 UTC  Set automatic aliases for snap "get-iplayer"
Done    today at 10:30 UTC  today at 10:34 UTC  Setup snap "get-iplayer" aliases
Done    today at 10:30 UTC  today at 10:34 UTC  Run post-refresh hook of "get-iplayer" snap if present
Done    today at 10:30 UTC  today at 10:34 UTC  Start snap "get-iplayer" (73) services
Done    today at 10:30 UTC  today at 10:34 UTC  Remove data for snap "get-iplayer" (40)
Done    today at 10:30 UTC  today at 10:34 UTC  Remove snap "get-iplayer" (40) from the system
Done    today at 10:30 UTC  today at 10:34 UTC  Clean up "get-iplayer" (73) install
Done    today at 10:30 UTC  today at 10:34 UTC  Run configure hook of "get-iplayer" snap if present
Done    today at 10:30 UTC  today at 10:34 UTC  Ensure prerequisites for "lxd" are available
Done    today at 10:30 UTC  today at 10:34 UTC  Download snap "lxd" (9298) from channel "stable"
Done    today at 10:30 UTC  today at 10:34 UTC  Fetch and check assertions for snap "lxd" (9298)
Done    today at 10:30 UTC  today at 10:34 UTC  Mount snap "lxd" (9298)
Done    today at 10:30 UTC  today at 10:34 UTC  Run pre-refresh hook of "lxd" snap if present
Done    today at 10:30 UTC  today at 10:34 UTC  Stop snap "lxd" services
Done    today at 10:30 UTC  today at 10:34 UTC  Remove aliases for snap "lxd"
Done    today at 10:30 UTC  today at 10:34 UTC  Make current revision for snap "lxd" unavailable
Done    today at 10:30 UTC  today at 10:34 UTC  Copy snap "lxd" data
Done    today at 10:30 UTC  today at 10:35 UTC  Setup snap "lxd" (9298) security profiles
Done    today at 10:30 UTC  today at 10:35 UTC  Make snap "lxd" (9298) available to the system
Done    today at 10:30 UTC  today at 10:35 UTC  Automatically connect eligible plugs and slots of snap "lxd"
Done    today at 10:30 UTC  today at 10:35 UTC  Set automatic aliases for snap "lxd"
Done    today at 10:30 UTC  today at 10:35 UTC  Setup snap "lxd" aliases
Done    today at 10:30 UTC  today at 10:35 UTC  Run post-refresh hook of "lxd" snap if present
Done    today at 10:30 UTC  today at 10:35 UTC  Start snap "lxd" (9298) services
Done    today at 10:30 UTC  today at 10:36 UTC  Remove data for snap "lxd" (8942)
Done    today at 10:30 UTC  today at 10:36 UTC  Remove snap "lxd" (8942) from the system
Done    today at 10:30 UTC  today at 10:36 UTC  Clean up "lxd" (9298) install
Done    today at 10:30 UTC  today at 10:37 UTC  Run configure hook of "lxd" snap if present

......................................................................
Make snap "core" (5662) available to the system

2018-10-26T10:30:46Z INFO Requested system restart.

......................................................................
Automatically connect eligible plugs and slots of snap "core"

2018-10-26T10:30:46Z INFO Waiting for restart...

......................................................................
Make snap "pc-kernel" (162) available to the system

2018-10-26T10:35:03Z INFO Requested system restart.

......................................................................
Automatically connect eligible plugs and slots of snap "pc-kernel"

2018-10-26T10:35:03Z INFO Waiting for restart...
2018-10-26T10:35:03Z INFO Waiting for restart...
2018-10-26T10:35:04Z INFO Waiting for restart...
2018-10-26T10:35:04Z INFO Waiting for restart...