1

I'd like be able to use systemd to reboot a system nicely at first, but with a pretty short timeout which, if exceeded, forces a reboot (perhaps with something like /proc/sysrq-trigger). It looked like all the pieces were there do this. I made a target that looks like this:

[Unit]
Description=My Forceful Reboot
DefaultDependencies=no
Requires=systemd-reboot.service
After=systemd-reboot.service
AllowIsolate=yes
JobTimeoutSec=30s
JobTimeoutAction=reboot-immediate

I could start or isolate this target and the system would attempt a graceful reboot and force a reboot if needed. It doesn't appear to work and it's been tricky to debug. I'm able to reboot the machine in other ways, and journalctl shows that services are being shutdown, but the reboot never happens.

Also, if reboot-immediate (which seems to use the reboot(2) system call) isn't forceful enough, can I somehow use /proc/sysrq-trigger?

Thanks for any help,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.