clearlinux / distribution

Placeholder repository to allow filing of general bugs/issues/etc against the Clear Linux OS for Intel Architecture linux distribution
521 stars 29 forks source link

Recommend reboot if kernel changed #1122

Open jurobystricky opened 5 years ago

jurobystricky commented 5 years ago

Describe the bug I performed manual update:

$ sudo swupd update
...
Statistics for going from version 30680 to version 30730:

    changed bundles   : 113
    new bundles       : 0
    deleted bundles   : 0

    changed files     : 2497
    new files         : 26117
    deleted files     : 24400

Starting download of remaining update content. This may take a while...
        ...100%
Staging file content
Applying update
        ...100%
Update was applied.
Calling post-update helper scripts
none
clr_debug_fuse.service: restarted (the binary was updated)
pacdiscovery.service: restarted (the binary was updated)
tallow.service: restarted (the binary was updated)
systemd-udevd.service: restarted (the binary was updated)
klogscanner.service: restarted (the binary was updated)
nginx.service: restarted (the binary was updated)
pacrunner.service: restarted (the binary was updated)
systemd-journald.service: restarted (the binary was updated)
mcelog.service: restarted (the binary was updated)
systemd-resolved.service: restarted (the binary was updated)
systemd-timesyncd.service: restarted (the binary was updated)
Update took 1327.9 seconds, 1761 MB transferred
934 files were not in a pack
Update successful. System updated from version 30680 to version 30730
juro@clear-nuc~/pr/blktrace $ 

Then I checked the kernel version:

$ uname -a
Linux clear-nuc 5.2.2-807.native clearlinux/swupd-client#1 SMP Tue Jul 23 17:42:01 PDT 2019 x86_64 GNU/Linux

Then I rebooted (for unrelated reasons) and checked the kernel version again:

$ uname -a
Linux clear-nuc 5.2.7-816.native clearlinux/swupd-client#1 SMP Tue Aug 6 11:32:34 PDT 2019 x86_64 GNU/Linux

Expected behavior So when does one need to reboot? I would expect swupd to detect a situation when a newer kernel that the one currently booted is installed/present and notify the user rebooting is recommended. Note the above message never mentions the kernel, just services being restarted. Otherwise the users may wrongly assume they are fully updated.

bwarden commented 5 years ago

We do this for all updates, but it might be good to have swupd specifically report this when called manually:

$ cat /run/motd.d/clr-boot-manager.motd
 * A kernel update is available: you may wish to reboot the system.
$ cat /run/motd.d/clr-service-restart.motd
 * Some system services need a restart.
   Run `sudo clr-service-restart -a -n` to view them.

...maybe even by looking for new files in that path and reporting the contents.

jurobystricky commented 5 years ago

As for "autoupdate": I have one system running with autoupdate enabled, currently it shows linux-5.2.5-813, which is also not the latest version. (OS is 30740)

Is user supposed to run

$ cat /run/motd.d/clr-boot-manager.motd

periodically to see if a reboot is recommended?

thiagomacieira commented 5 years ago

You'll see it every time you log in. If you most often work via ssh, this is probably sufficient.

If you use a GUI desktop, then we need a different notification mechanism. We should have a passive notification saying "your system was updated, you should reboot at your earliest convenience".

[Definitely not "It's Tuesday, you have to reboot in 24 hours!"]