Read /proc/sys/kernel/ctrl-alt-del for reboot behavior#264
Conversation
docs/man/kmscon.conf.1.xml.in
Outdated
| Use with caution as the reboot is immediate. | ||
| The reboot behavior follows the system-wide setting in | ||
| /proc/sys/kernel/ctrl-alt-del: when set to 0 (default), | ||
| a graceful soft reboot is performed by signaling init; |
There was a problem hiding this comment.
"signalling init" seems to be a bit unclear
There was a problem hiding this comment.
Agreed! Changed to "sending SIGINT to init (PID 1)" for consistency with the example config and better technical clarity.
scripts/etc/kmscon.conf.example
Outdated
| ## Reboot system (disabled by default, use with caution - immediate reboot without confirmation) | ||
| ## Reboot system (disabled by default) | ||
| ## Reboot behavior follows /proc/sys/kernel/ctrl-alt-del: | ||
| ## 0 (default): graceful soft reboot via init |
There was a problem hiding this comment.
Good point! Changed to "graceful reboot (sends SIGINT to init)" for clarity on the technical mechanism.
|
Looks good to me, just resolve the last comment about the man page from @Karlson2k, and I'll merge it. |
|
@kdj0c @Karlson2k Both documentation comments have been addressed and updated for clarity. Ready for merge! 🚀 |
|
The docs still could be better (clearer), but I think it is good enough to merge. |
Instead of adding a new configuration parameter, this change makes kmscon respect the system-wide ctrl-alt-del setting. When ctrl-alt-del is 0 (default), a soft reboot is performed by signaling init (PID 1) with SIGINT, allowing for a graceful shutdown. When ctrl-alt-del is > 0, an immediate hard reboot is performed after syncing disk buffers. This approach follows the system configuration and eliminates the need for an additional kmscon-specific parameter.
2f2f760 to
bb6bfde
Compare
|
I just squashed the 3 commits in one, and rebased, to have cleaner git history. |
Makes sense. Thanks ! |
Summary
This PR addresses the feedback from #260 by implementing reboot behavior that respects the system-wide
/proc/sys/kernel/ctrl-alt-delsetting instead of adding a new kmscon-specific parameter.Motivation
In PR #260, I initially proposed adding a
--grab-reboot-modeparameter. The maintainer suggested a better approach: reading/proc/sys/kernel/ctrl-alt-delto respect the system's existing configuration.Changes
Implementation (
src/kmscon_seat.c)seat_trigger_reboot()to read/proc/sys/kernel/ctrl-alt-delat runtime0(default): performs soft reboot by sendingSIGINTto PID 1 (init)>0: performs hard reboot withsync()thenreboot(RB_AUTOBOOT)Documentation
docs/man/kmscon.conf.1.xml.in) to explain the behaviorscripts/etc/kmscon.conf.example) with clear commentsTesting
Related