davmac314 / dinit

Service monitoring / "init" system
Apache License 2.0
622 stars 49 forks source link

add soft-reboot #357

Closed YukariChiba closed 3 months ago

YukariChiba commented 4 months 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 3 months ago

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

davmac314 commented 3 months ago

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