Bug#374039: shutdown -h -H: warn that then cannot poweroff perhaps

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#374039: shutdown -h -H: warn that then cannot poweroff perhaps

積丹尼 Dan Jacobson
Package: sysvinit
Version: 2.86.ds1-14.1
Severity: wishlist
File: /sbin/shutdown

Regarding: HALT OR POWEROFF
       The -H option just sets the  init  environment  variable  INIT_HALT  to
       HALT,  and the -P option just sets that variable to POWEROFF. The shut-
       down script that calls halt(8)  as  the  last  thing  in  the  shutdown
       sequence should check these environment variables and call halt(8) with
       the right options for  these  options  to  actually  have  any  effect.
       Debian 3.1 (sarge) supports this.

1. I don't see any "scripts" left. They are all "ELF 32-bit LSB
       executable", no?

2. The halt(1) man page doesn't mention any INIT_HALT environment
   variable.

3. Well, I tried "-h -H", and guess what, it put my IBM Thinkpad in a
   unrebootable state... no button would respond, no way to poweroff
   either. I had to remove the AC cord, and remove the battery, to
   finally poweroff. So perhaps add a warning to the man page.


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#374039: shutdown behavior (Was: Addressing more sysvinit bugs)

Benda Xu-3
Hi Jesse,

Jesse Smith <[hidden email]> writes:

> 374039 (I think the reporter is confusing initscripts (init.d) with the
> sysvinit programs as they're mixing up script variables with sysvinit
> manual pages. Can close this report.)

Jidanni's concern is in the shutdown(8) manpage.

1. `shutdown` is no longer a script. The manpage should reflect that.

2. INIT_HALT is handled in /etc/init.d/halt, not /sbin/halt.

3. use `shutdown -h -H` with caution.  I don't have a clue.

4. It is not interesting to mention "Debian Sarge" in manpage anymore.


It would be great if they could be addressed upstream.

Yours,
Benda

Reply | Threaded
Open this post in threaded view
|

Bug#374039: shutdown behavior (Was: Addressing more sysvinit bugs)

Jesse Smith
On 11/14/18 10:54 PM, Benda Xu wrote:

> Hi Jesse,
>
> Jesse Smith <[hidden email]> writes:
>
>> 374039 (I think the reporter is confusing initscripts (init.d) with the
>> sysvinit programs as they're mixing up script variables with sysvinit
>> manual pages. Can close this report.)
>
> Jidanni's concern is in the shutdown(8) manpage.
>
> 1. `shutdown` is no longer a script. The manpage should reflect that.
>
> 2. INIT_HALT is handled in /etc/init.d/halt, not /sbin/halt.
>
> 3. use `shutdown -h -H` with caution.  I don't have a clue.
>
> 4. It is not interesting to mention "Debian Sarge" in manpage anymore.
>
>
> It would be great if they could be addressed upstream.
>
> Yours,
> Benda
>


1. The man page doesn't refer to shutdown as a script, it is talking
about the scripts init calls to shutdown the system. This is a bit
confusing as the shutdown program shutdowns the system and gets init to
call a series of shutdown scripts. (Really, it is a matter of using the
same term to refer to multiple things.) I'll try to clear up the manual
page by using other terms.

2. Yes, INIT_HALT is checked in /etc/init.d/halt, but that script then
calls /sbin/halt. Again, this is a case of everything having the same
name. It looks like the man page is correct, just confusing because so
many things are called "halt".

3. I'm not sure to what this refers.

4. Agreed, I will remove the Sarge reference as it is very dated.

- Jesse

Reply | Threaded
Open this post in threaded view
|

Bug#374039: shutdown behavior (Was: Addressing more sysvinit bugs)

Dmitry Bogatov-3

control: tags -1 +upstream

[2018-11-15 13:20] Jesse Smith <[hidden email]>

> On 11/14/18 10:54 PM, Benda Xu wrote:
> > Hi Jesse,
> >
> > Jesse Smith <[hidden email]> writes:
> >
> >> 374039 (I think the reporter is confusing initscripts (init.d) with the
> >> sysvinit programs as they're mixing up script variables with sysvinit
> >> manual pages. Can close this report.)
> >
> > Jidanni's concern is in the shutdown(8) manpage.
> >
> > 1. `shutdown` is no longer a script. The manpage should reflect that.
> >
> > 2. INIT_HALT is handled in /etc/init.d/halt, not /sbin/halt.
> >
> > 3. use `shutdown -h -H` with caution.  I don't have a clue.
> >
> > 4. It is not interesting to mention "Debian Sarge" in manpage anymore.
> >
> >
> > It would be great if they could be addressed upstream.
> >
> > Yours,
> > Benda
> >

As of sysvinit=2.93, I believe

> 1. The man page doesn't refer to shutdown as a script, it is talking
> about the scripts init calls to shutdown the system. This is a bit
> confusing as the shutdown program shutdowns the system and gets init to
> call a series of shutdown scripts. (Really, it is a matter of using the
> same term to refer to multiple things.) I'll try to clear up the manual
> page by using other terms.

this concern was addressed and everything is fine.

> 2. Yes, INIT_HALT is checked in /etc/init.d/halt, but that script then
> calls /sbin/halt. Again, this is a case of everything having the same
> name. It looks like the man page is correct, just confusing because so
> many things are called "halt".

this is described fine in manual.

> 3. I'm not sure to what this refers.

Behaviour of `shutdown -h -H` is very strange. "Halt action is to halt
or drop into boot monitor on systems that support it." is not enough to
convey, that in many cases it brings machine into state, when it is
still on, display still showing letters, but no interation (except
physical poweroff) is possible.

Maybe -H is actually produces useful behaviour in some cases (no idea),
but please add into manpage warning like "Do not use -H option, unless
you really know what are you doing."

> 4. Agreed, I will remove the Sarge reference as it is very dated.

I see. It is gone. Wonderful.
--
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --

Reply | Threaded
Open this post in threaded view
|

Bug#374039: #374039 shutdown -h -H: warn that then cannot poweroff perhaps

Jesse Smith-2
In reply to this post by 積丹尼 Dan Jacobson
> Halt action is to halt or drop into boot monitor on systems that
> support it." is not enough to convey, that in many cases it brings
> machine into state, when it is still on, display still showing
> letters, but no interation (except physical poweroff) is possible.

That is what halt means - to stop running the system without powering off.

> "Maybe -H is actually produces useful behaviour in some cases (no
> idea), but please add into manpage warning like "Do not use -H option,
> unless you really know what are you doing."

Halting is often used to run through the shutdown process and leave
output on the screen for debugging purposes. Or when you want the OS to
stop, but leave the power on. There is no negative side-effect to using
the -H option, no loss of data. There isn't any reason to print an extra
warning.

Which brings me back to the original bug report which read: "Well, I
tried "-h -H", and guess what, it put my IBM Thinkpad in a unrebootable
state... no button would respond, no way to poweroff either. I had to
remove the AC cord, and remove the battery, to finally poweroff. So
perhaps add a warning to the man page."

The user could, in that case, just press and hold the power button for
five seconds to power off the machine. There is no need to remove the AC
power or take out the battery. Holding the power button works on all
workstations and laptops made in the past 20 years. It's common practise
for any time a machine hangs, has a kernel panic or stops responding to
keyboard input.

Reply | Threaded
Open this post in threaded view
|

Bug#374039: #374039 shutdown -h -H: warn that then cannot poweroff perhaps

Dmitry Bogatov-3

control: tags -1 +upstream

[ Please keep attribution ]

[2019-04-07 11:12] Jesse Smith <[hidden email]>
> > Halt action is to halt or drop into boot monitor on systems that
> > support it." is not enough to convey, that in many cases it brings
> > machine into state, when it is still on, display still showing
> > letters, but no interation (except physical poweroff) is possible.
>
> That is what halt means - to stop running the system without powering
> off.

Maybe, but many of us are accustomed that /sbin/halt turns off the computer,
so here comes confusion.

> > "Maybe -H is actually produces useful behaviour in some cases (no
> > idea), but please add into manpage warning like "Do not use -H option,
> > unless you really know what are you doing."
>
> Halting is often used to run through the shutdown process and leave
> output on the screen for debugging purposes. Or when you want the OS to
> stop, but leave the power on. There is no negative side-effect to using
> the -H option, no loss of data. There isn't any reason to print an extra
> warning.

Okay, what about including this explanation into manpage? I know, Unix
is about sharp tools, but before I started working on sysvinit, I
believed, that "halt == turn-off", so extra explanation, that it is
different things would be nice to user.
--
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --

Reply | Threaded
Open this post in threaded view
|

Bug#374039: #374039 shutdown -h -H: warn that then cannot poweroff perhaps

Jesse Smith-2
On 4/8/19 12:38 PM, Dmitry Bogatov wrote:

> control: tags -1 +upstream
>
> [ Please keep attribution ]
>
> [2019-04-07 11:12] Jesse Smith <[hidden email]>
>>
>> That is what halt means - to stop running the system without powering
>> off.
> Maybe, but many of us are accustomed that /sbin/halt turns off the computer,
> so here comes confusion.

That is certainly true, but I'd like to point out that /sbin/halt only
turns off the computer because Debian modifies halt's behaviour. If you
run /sbin/halt without Debian's modifications, the traditional action
(stop without powering off) occurs. I'd almost consider this a bug since
/sbin/halt should be used to stop the system while /sbin/poweroff should
be used to, well, turn off the power to the system.


>> Halting is often used to run through the shutdown process and leave
>> output on the screen for debugging purposes. Or when you want the OS to
>> stop, but leave the power on. There is no negative side-effect to using
>> the -H option, no loss of data. There isn't any reason to print an extra
>> warning.
> Okay, what about including this explanation into manpage? I know, Unix
> is about sharp tools, but before I started working on sysvinit, I
> believed, that "halt == turn-off", so extra explanation, that it is
> different things would be nice to user.

I'm in favour of this change and can expand on the explanation in the
manual page for the next release.

Reply | Threaded
Open this post in threaded view
|

Bug#374039: #374039 shutdown -h -H: warn that then cannot poweroff perhaps

Dmitry Bogatov-3

control: tags -1 +fixed-upstream

[2019-04-08 12:54] Jesse Smith <[hidden email]>

> On 4/8/19 12:38 PM, Dmitry Bogatov wrote:
> > control: tags -1 +upstream
> >
> > [ Please keep attribution ]
> >
> > [2019-04-07 11:12] Jesse Smith <[hidden email]>
> >>
> >> That is what halt means - to stop running the system without powering
> >> off.
> > Maybe, but many of us are accustomed that /sbin/halt turns off the computer,
> > so here comes confusion.
>
> That is certainly true, but I'd like to point out that /sbin/halt only
> turns off the computer because Debian modifies halt's behaviour. If you
> run /sbin/halt without Debian's modifications, the traditional action
> (stop without powering off) occurs. I'd almost consider this a bug since
> /sbin/halt should be used to stop the system while /sbin/poweroff should
> be used to, well, turn off the power to the system.

I believe at least in some of RPM-based distributions /sbin/halt also
turns off computer. But it is just outdated memories from my studentship
times :)

> >> Halting is often used to run through the shutdown process and leave
> >> output on the screen for debugging purposes. Or when you want the OS to
> >> stop, but leave the power on. There is no negative side-effect to using
> >> the -H option, no loss of data. There isn't any reason to print an extra
> >> warning.
> > Okay, what about including this explanation into manpage? I know, Unix
> > is about sharp tools, but before I started working on sysvinit, I
> > believed, that "halt == turn-off", so extra explanation, that it is
> > different things would be nice to user.
>
> I'm in favour of this change and can expand on the explanation in the
> manual page for the next release.

Thank you!
--
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --

Reply | Threaded
Open this post in threaded view
|

Bug#374039: #374039 shutdown -h -H: warn that then cannot poweroff perhaps

Adam Borowski-3
On Thu, Apr 11, 2019 at 10:42:38AM +0000, Dmitry Bogatov wrote:

> [2019-04-08 12:54] Jesse Smith <[hidden email]>
> > On 4/8/19 12:38 PM, Dmitry Bogatov wrote:
> > > Maybe, but many of us are accustomed that /sbin/halt turns off the computer,
> > > so here comes confusion.
> >
> > That is certainly true, but I'd like to point out that /sbin/halt only
> > turns off the computer because Debian modifies halt's behaviour. If you
> > run /sbin/halt without Debian's modifications, the traditional action
> > (stop without powering off) occurs. I'd almost consider this a bug since
> > /sbin/halt should be used to stop the system while /sbin/poweroff should
> > be used to, well, turn off the power to the system.

A computer being able to control its own power is a relatively new thing.
Systems of old had only "halt", and without a separate command, it was
changed to power off once that functionality appeared in the hardware.  For
PCs, it was at the time of AT -> ATX.

> I believe at least in some of RPM-based distributions /sbin/halt also
> turns off computer. But it is just outdated memories from my studentship
> times :)

Your memory agrees with mine.  Making "halt" not turn off capable hardware
is a systemd change.

On one hand, it follows the name of these commands.  On the other, I can't
quite fathom the purpose of that infinite loop.  If someone for some weird
reason wanted the final hang, you can kexec that or something -- it's a
really odd case.


Meow!
--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Did ya know that typing "test -j8" instead of "ctest -j8"
⢿⡄⠘⠷⠚⠋⠀ will make your testsuite pass much faster, and fix bugs?
⠈⠳⣄⠀⠀⠀⠀