davmac314 / dinit

Service monitoring / "init" system
Apache License 2.0
582 stars 45 forks source link

add soft-reboot #357

Closed YukariChiba closed 1 month ago

YukariChiba commented 1 month ago

this commit adds initial support for soft-reboot command to shutdown, which is similar to systemd's soft-reboot, but without root switching.

Early services need to be idempotent for soft-reboot to work properly.


Updated: added an argument --ignore-sys-args to ignore kernel args, which would be added automatically in soft-reboot execv.

Updated: filtered out "single" argument

Updated: The re-execv-ing retains boot-time parameters to simplify the code and is consistent with systemd's soft-reboot behavior.

YukariChiba commented 1 month ago

The behavior of soft-reboot has been described in the documentation.

davmac314 commented 1 month ago

Thanks, now merged. If you would like to add yourself to the CONTRIBUTORS file, please open another pull request to do so. :)