[systemd-devel] ctrl-s + shutdown
Lennart Poettering
lennart at poettering.net
Fri Jun 1 07:19:23 PDT 2012
On Fri, 01.06.12 12:33, Lukáš Nykrýn (lnykryn at redhat.com) wrote:
> Hello,
> A customer had complained about this behavior:
> 1) login to system
> 2) press ctrl+s
> 3) log to this computer from another machine using ssh
> 4) type shutdown -h now through ssh
> 5) ?
>
> Their problem is that in RHEL5(sysvinit) 5) is "nothing until user press
> ctrl+q, than shutdown" but in RHEL6(upstart) system goes to shutdown
> immediately.
>
> I was not sure which one is correct, so I tried what would systemd
> (44-12.fc17) do in this case.
>
> Result are quite inconsistent. In some cases system shutdowns
> immediately, sometime shutdown command hanged and system waited for
> ctrl-q and few times ssh disconnect and screen went completely black and
> system hanged.
Well, whenever an app tries to output something on the console while it
is frozen it will hang. Sooner or later systemd will do this too.
So this is really just a matter of generating output or not.
Not sure if we can do much about this. Maybe using O_NONBLOCK might
help, but we probably should set that for serial consoles, so we should
take real care with this.
> Unfortunately I have only one f17 in virtual to test this, so I want to
> ask if somebody else can try it and obvious question is: What is correct
> behavior?
Of course, ideally stopping the console should not have any impact on
systemd. But I fear this is not entirely fixable right now, unless you
completely turn off all console output in systemd.
But admittedly I haven't checked in detail how O_NONBLOCK and a stopped
VT really interact, need to check this...
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list