Skip to content

Comments

docs: Add warnings about hard reboot mode and clarify soft mode behavior#260

Closed
jtollet wants to merge 4 commits intokmscon:mainfrom
jtollet:docs/add-reboot-mode-warnings
Closed

docs: Add warnings about hard reboot mode and clarify soft mode behavior#260
jtollet wants to merge 4 commits intokmscon:mainfrom
jtollet:docs/add-reboot-mode-warnings

Conversation

@jtollet
Copy link
Contributor

@jtollet jtollet commented Jan 28, 2026

Summary

Following @Karlson2k's feedback on PR #176, this PR adds clear warnings about the dangers of "hard" mode (immediate reboot without proper shutdown) which can cause data loss and filesystem corruption.

Changes

  • Updated man pages (kmscon.1 and kmscon.conf.1) with detailed WARNING sections
  • Updated kmscon.conf.example with prominent DATA LOSS warning
  • Clarified that "soft" mode (default) matches standard Linux console Ctrl-Alt-Del behavior (SIGINT to PID 1)
  • Clarified that "hard" mode performs immediate reboot via reboot(RB_AUTOBOOT) with sync() but without proper shutdown sequence

Documentation Updates

The documentation now explicitly states that:

  • "soft" mode (default) sends SIGINT to PID 1 (system init) for a clean reboot, matching the standard Linux console Ctrl-Alt-Del behavior
  • "hard" mode calls sync() to flush disk buffers, then reboot(RB_AUTOBOOT) for an immediate reboot without proper shutdown sequence
  • WARNING about potential data loss and filesystem corruption with hard mode (despite sync(), the system doesn't perform proper shutdown of services, unmounting, etc.)

Testing

Both modes have been tested on real hardware:

  • ✅ soft mode: clean shutdown via SIGINT to PID 1
  • ✅ hard mode: sync() followed by immediate reboot via RB_AUTOBOOT

This addresses the concerns raised in #176 (comment)

Following Karlson2k's feedback on PR kmscon#176, this commit adds clear warnings
about the dangers of "hard" mode (immediate reboot without proper shutdown)
which can cause data loss and filesystem corruption.

The documentation now explicitly states that:
- "soft" mode (default) sends SIGINT to PID 1 for a clean reboot,
  matching the standard Linux console Ctrl-Alt-Del behavior
- "hard" mode performs an immediate reboot via reboot(RB_AUTOBOOT)
  with sync() but without proper shutdown sequence

Changes:
- Updated man pages (kmscon.1 and kmscon.conf.1) with detailed warnings
- Updated kmscon.conf.example with prominent DATA LOSS warning
- Clarified that soft mode matches Linux console behavior users expect

Tested on real hardware with both modes:
- soft mode: clean shutdown via SIGINT to PID 1 ✓
- hard mode: immediate reboot via RB_AUTOBOOT ✓
@kdj0c
Copy link
Contributor

kdj0c commented Jan 29, 2026

Thanks for your contribution. However I feel like adding a new parameter is a bit too much.

I would prefer either always using the "soft reboot", or reading /proc/sys/kernel/ctrl-alt-del and acting accordingly.

/proc/sys/kernel/ctrl-alt-del

  • This file controls the handling of Ctrl-Alt-Del from the
    keyboard. When the value in this file is 0, Ctrl-Alt-Del
    is trapped and sent to the init(1) program to handle a
    graceful restart. When the value is greater than zero,
    Linux's reaction to a Vulcan Nerve Pinch (tm) will be an
    immediate reboot, without even syncing its dirty buffers.
    Note: when a program (like dosemu) has the keyboard in
    "raw" mode, the Ctrl-Alt-Del is intercepted by the program
    before it ever reaches the kernel tty layer, and it's up to
    the program to decide what to do with it.

@jtollet
Copy link
Contributor Author

jtollet commented Jan 29, 2026

Thank you for the feedback! I've created a new PR that implements your suggested approach of reading /proc/sys/kernel/ctrl-alt-del instead of adding a new parameter: #264

This PR can be closed as it's superseded by the new approach.

@jtollet
Copy link
Contributor Author

jtollet commented Jan 29, 2026

Closing in favor of #264 which implements the suggested approach.

@jtollet jtollet closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants