Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document how to switch to single-user mode #24928

Merged
merged 1 commit into from
Oct 7, 2022
Merged

Conversation

anarcat
Copy link
Contributor

@anarcat anarcat commented Oct 6, 2022

Before Debian switched to systemd, shutdown now would reset the system into
single user mode, doing roughly the equivalent of telinit 1.

Now, systemd's shutdown command does not behave that way; it defaults to
poweroff which might be confusing for users (like me) used to the previous
method.

Because I don't use the command often, I keep being stumped by this behavior,
and every time I look at the shutdown(1) manpage, I don't understand why I
can't find what I am looking for. This patch should make sure that people like
me find their way back to some sort of reason.

Maybe the proper way to fix this would be to restore the more classic
behavior, but I'm definitely not going to climb that hill. Besides, I clearly
remember the time I found out about the shutdown command and was really
confused when it brought me back to a command-line prompt. That was really
counter-intuitive and I find that change to actually be a good thing. So I'm
not proposing to change this behavior, merely document it better.

I originally added this to the -P option but it was suggested adding a new
COMPATIBILITY section instead, where other such issues could be added.

The COMPATIBILITY section is not actually officially documented. man(1)
talks about a CONFORMING TO section, but shutdown(1) is not
POSIX (shutdown(2) is, of course), so there's no actual standard on how this
should work.

The other option I considered was to add a BUGS section, but that seemed to
inflammatory, and definitely counter-productive.

@anarcat
Copy link
Contributor Author

anarcat commented Oct 6, 2022

Before Debian switched to systemd, shutdown now would reset the system into single user mode, doing roughly the equivalent of telinit 1.

If people are doubting this, their memory, or mine, they are welcome to review the sysvinit shutdown manpage:

https://manpages.debian.org/bullseye/sysvinit-core/shutdown.8.en.html

which explicitly says:

shutdown does its job by signalling the init process, asking it to change the runlevel. Runlevel 0 is used to halt the system, runlevel 6 is used to reboot the system, and runlevel 1 is used to put to system into a state where administrative tasks can be performed; this is the default if neither the -h or -r flag is given to shutdown.

man/shutdown.xml Outdated Show resolved Hide resolved
@keszybz keszybz added documentation reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks labels Oct 6, 2022
@anarcat anarcat force-pushed the patch-1 branch 2 times, most recently from 6b5d06d to b8b13e4 Compare October 6, 2022 15:52
@bluca bluca removed the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Oct 7, 2022
@anarcat anarcat changed the title document how to fallback to single-user mode document how to fall back to single-user mode Oct 7, 2022
@anarcat anarcat force-pushed the patch-1 branch 2 times, most recently from fd35c2e to b34fda2 Compare October 7, 2022 13:31
@anarcat anarcat changed the title document how to fall back to single-user mode document how to switch to single-user mode Oct 7, 2022
Before Debian switched to systemd, `shutdown now` would reset the system into
single user mode, doing roughly the equivalent of `telinit 1`.

Now, systemd's `shutdown` command does not behave that way; it defaults to
`poweroff` which might be confusing for users (like me) used to the previous
method.

Because I don't use the command often, I keep being stumped by this behavior,
and every time I look at the `shutdown(1)` manpage, I don't understand why I
can't find what I am looking for. This patch should make sure that people like
me find their way back to some sort of reason.

Maybe the *proper* way to fix this would be to restore the more classic
behavior, but I'm definitely not going to climb that hill. Besides, I clearly
remember the time I found out about the `shutdown` command and was *really*
confused when it brought me back to a command-line prompt. That was really
counter-intuitive and I find that change to actually be a good thing. So I'm
not proposing to change this behavior, merely document it better.

I originally added this to the `-P` option but it was suggested adding a new
`COMPATIBILITY` section instead, where other such issues could be added.

The `COMPATIBILITY` section is not actually officially documented. `man(1)`
talks about a `CONFORMING TO` section, but `shutdown(1)` is not
POSIX (`shutdown(2)` is, of course), so there's no actual standard on how this
should work.

The other option I considered was to add a `BUGS` section, but that seemed to
inflammatory, and definitely counter-productive.
@keszybz keszybz merged commit 9aafd31 into systemd:main Oct 7, 2022
@anarcat anarcat deleted the patch-1 branch October 11, 2022 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants