Stop Paying Full Reboot Downtime: Practical systemd soft-reboot on Linux
Описание и применение
Использование systemd soft-reboot позволяет перезапустить только пользовательское пространство, сохраняя ядро и аппаратное состояние, тем самым сокращая время простоя после обновлений пакетов.
Задача
After a userspace package update, the system remains running old libraries while the kernel stays unchanged, causing unnecessary full reboot downtime.
Результат
Using systemd soft-reboot reduces downtime by restarting only userspace while keeping the kernel and hardware state intact, enabling quick recovery after package updates and optional root flips.
Рабочий процесс
- 1. Verify systemd version ≥254 and presence of soft-reboot.target.
- 2. Ensure root or polkit rights to run power commands.
- 3. (Optional) Prepare /run/nextroot/ with a new root filesystem if a root flip is needed.
- 4. Run
sudo systemctl soft-reboot(or with --when/--force as needed). - 5. Systemd isolates to soft-reboot.target, stops services, unmounts shutdown graph mounts, then reexecutes PID 1.
- 6. If /run/nextroot/ exists, kernel switches root before reexec.
- 7. New userspace boot transaction starts; services restart under the same kernel.
- 8. Verify by checking kernel release (
uname -runchanged) and timestamps (UserspaceTimestamp advanced).
Доказательства
systemctl soft-reboot was added in systemd 254.
soft-reboot isolates toward soft-reboot.target, which requires systemd-soft-reboot.service.
If /run/nextroot/ exists, the root filesystem is switched to it.
- Дата записи: 2026-09-13T20:30:53.266Z