Closed schaefi closed 4 years ago
Change looks good, I just want to do a rebuild and test here for my own sanity :-)
...just doing a couple more tests...
Either one of the following will fix it, without any changes to the mount code needed:
index 3069725..0d43a40 100644
--- a/suse_migration_services/units/reboot.py
+++ b/suse_migration_services/units/reboot.py
@@ -69,12 +69,12 @@ def main():
log.info(
# reboot is performed through systemd. The call through
# systemd checks if there is a kexec loaded kernel and
- # transparently turns 'systemctl reboot' into
- # 'systemctl kexec'. Thus both ways, soft and hard
- # reboot are managed in one call.
+ # transparently turns 'reboot' into 'systemctl kexec'.
+ # Thus both ways, soft and hard reboot are managed in
+ # one call.
'Reboot system: {0}{1}'.format(
os.linesep, Command.run(
- ['systemctl', 'reboot']
+ ['reboot']
)
)
)
-- or --
index 3069725..850e97e 100644
--- a/suse_migration_services/units/reboot.py
+++ b/suse_migration_services/units/reboot.py
@@ -66,15 +66,14 @@ def main():
)
)
)
+ if MigrationConfig().is_soft_reboot_requested():
+ reboot_cmd = 'kexec'
+ else:
+ reboot_cmd = 'reboot'
log.info(
- # reboot is performed through systemd. The call through
- # systemd checks if there is a kexec loaded kernel and
- # transparently turns 'systemctl reboot' into
- # 'systemctl kexec'. Thus both ways, soft and hard
- # reboot are managed in one call.
'Reboot system: {0}{1}'.format(
os.linesep, Command.run(
- ['systemctl', 'reboot']
+ ['systemctl', reboot_cmd]
)
)
)
Thanks much for your investigations. I'll adapt the code. I like if we can stay explicit in the code
closing on behalf of #146
Since the change to let systemd drive the reboot process it is needed to keep the kernel filesystems proc, sys and dev open to let systemd perform its job. The umounting prior to reboot will be taken over by systemd as well. However if systemd can't read e.g the state of kexec through /sys it can't work as expected