Bug 476077 - Support for systemd soft-reboot for faster reboots
Summary: Support for systemd soft-reboot for faster reboots
Status: RESOLVED INTENTIONAL
Alias: None
Product: plasmashell
Classification: Plasma
Component: Session Management (other bugs)
Version First Reported In: 5.27.9
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-25 08:39 UTC by Oleksandr Natalenko
Modified: 2024-08-30 22:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oleksandr Natalenko 2023-10-25 08:39:16 UTC
Hello.

Since v254 systemd supports a so-called "soft-reboot" action, where the whole userspace is reloaded without restarting the kernel [1] [2]:

```
    * A new "soft-reboot" mechanism has been added to the service manager.
      A "soft reboot" is similar to a regular reboot, except that it
      affects userspace only: the service manager shuts down any running
      services and other units, then optionally switches into a new root
      file system (mounted to /run/nextroot/), and then passes control to a
      systemd instance in the new file system which then starts the system
      up again. The kernel is not rebooted and neither is the hardware,
      firmware or boot loader. This provides a fast, lightweight mechanism
      to quickly reset or update userspace, without the latency that a full
      system reset involves. Moreover, open file descriptors may be passed
      across the soft reboot into the new system where they will be passed
      back to the originating services. This allows pinning resources
      across the reboot, thus minimizing grey-out time further. This new
      reboot mechanism is accessible via the new "systemctl soft-reboot"
      command.
```

It would be nice to have a possibility to trigger this from the KDE's shutdown menu.

Please consider.

Thanks.

[1] https://www.freedesktop.org/software/systemd/man/latest/systemd-soft-reboot.service.html
[2] https://github.com/systemd/systemd/releases/tag/v254
Comment 1 Nate Graham 2023-10-25 21:06:42 UTC
So the advantage to the user would be faster rebooting? Can you anticipate what any of the disadvantages would be?
Comment 2 Oleksandr Natalenko 2023-10-25 21:22:00 UTC
(In reply to Nate Graham from comment #1)
> So the advantage to the user would be faster rebooting? Can you anticipate
> what any of the disadvantages would be?

The disadvantage is that if a user updates the kernel, the update will not be applied. On Arch I think in this case the reboot will even fail completely because multiple kernels are not supported, and a new one overwrites the old one, and this breaks modules.

But that's by design. I do not see other disadvantages.
Comment 3 Nate Graham 2023-10-26 21:19:09 UTC
Thanks for the explanation.

I wonder how we could implement this without having to explain anything to the user, though. That would be a dealbreaker.
Comment 4 Oleksandr Natalenko 2023-10-26 21:42:11 UTC
(In reply to Nate Graham from comment #3)
> Thanks for the explanation.
> 
> I wonder how we could implement this without having to explain anything to
> the user, though. That would be a dealbreaker.

I'd probably disable this by default, leave an option to enable it somewhere in the System Settings having some helpful text there, and then still hide it under a long click/drop-down/ctrl_or_whatever+click on the existing "Reboot" button.
Comment 5 Nate Graham 2024-08-30 22:40:49 UTC
Seems like the advantage would be outweighed by the complication, opportunity for bugs, and challenge of explaining to users how this works. At the moment I don't think we'll be able to prioritize this, sorry.

However, that can be reconsidered if anyone submits a patch that addresses those issues adequately.

Thanks anyway!