openSUSE / transactional-update

Atomic updates for Linux operating systems
Other
110 stars 32 forks source link

reboot is not working properly with method auto or rebootmgr #92

Closed mbussolotto closed 2 years ago

mbussolotto commented 2 years ago

Environment

Issue

Running from salt master:

salt 'min-slemicro52.tf.local' transactional_update.call pkg.install dialog activate_transaction=True

the package is correctly installed but the snaphot is not activated. The error in /var/log/salt/minion is:

stderr: The system couldn't be rebooted using method 'auto'. Please reboot the system

/etc/transactional-update.conf is:

# Configuration file for transactional-update
# See transactional-update.conf(5) for details

# Reboot method
# Valid values: auto salt rebootmgr systemd kexec none
REBOOT_METHOD=auto

# zypper update method
# Valid values: dup up
UPDATE_METHOD=up

# Import new repository GPG keys automatically
# Valid values: 0 1
#ZYPPER_AUTO_IMPORT_KEYS=0

and /etc/rebootmgr.conf is:

[rebootmgr]
window-start=03:30
window-duration=1h30m
strategy=now
lock-group=default

I think the problem is in the tukit command itself, since the command tukit reboot auto does not work. Same issue using rebootmgr and salt (this one does not appear in tukit but it's present in transactional-update.conf).

Workaround The only reboot method that works properly is systemd (I tested it via salt ad using tukit and works fine in both cases).

laenion commented 2 years ago

the package is correctly installed but the snaphot is not activated. The error in /var/log/salt/minion is:

stderr: The system couldn't be rebooted using method 'auto'. Please reboot the system

I'm sorry, I just realized that this message is a bogus message - it appears even when the reboot was successfully triggered. Fixing.

That, however, shouldn't prevent the snapshot from being activated. Are you sure this doesn't work?

I think the problem is in the tukit command itself, since the command tukit reboot auto does not work.

I couldn't reproduce the tukit reboot auto command not working; what didn't work as expected for me (with the message from above) is calling transactional-update reboot.

What does rebootmgrctl status say?

Same issue using rebootmgr and salt (this one does not appear in tukit but it's present in transactional-update.conf).

salt still appearing in the configuration file is an oversight; that reboot method has been used for CaaSP and has been removed since then. Removing.

Workaround The only reboot method that works properly is systemd (I tested it via salt ad using tukit and works fine in both cases).

Probably because systemd is faster in rebooting the system than the shell in showing the error message - and that's most likely the reason why I haven't noticed it.

mbussolotto commented 2 years ago

Thanks for your help @laenion ! You're right, it was just the misleading message (and the salt oversight) :) The reason why tukit reboot auto was not working ws for a misconfiguration in /etc/rebootmgr.conf :

strategy=now

it's supposed to be

strategy=instantly

I had other test setting the maintenance window and it works as expected.

So briefly, besides the log message and and salt oversight, there're no issue. Feel free to close the issue, thanks!

laenion commented 2 years ago

Will close after submitting the two fixes - there are still two bugs in here :-)

admd commented 2 years ago

Sorry for using this issue for this but where can I find more information about the reboot method salt which has been removed now @laenion ?

laenion commented 2 years ago

@admd: That reboot method has been removed a long time ago in https://github.com/openSUSE/transactional-update/commit/e10429cc8dc993109def0dd7f79e545c3f5e117d, transactional-update 2.22 was the last version to contain it. It didn't use any general Salt functionality either, it was completely CaaSP specific. Nothing of interest here :-)

laenion commented 2 years ago

Fixes submitted and part of transactional-update 4.1.0.