Re: [master] Prevent init from telling us its story if the shutdown was planned.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/21/2010 06:14 PM, Ales Kozumplik wrote:
> On 01/21/2010 05:23 PM, Steffen Maier wrote:
>> On 01/21/2010 04:33 PM, Ales Kozumplik wrote:
>>> On 01/21/2010 04:26 PM, Ales Kozumplik wrote:
>>>> dcantrell's recent change to the shutdown mechanism exposed a
>>>> situation when
>>>> shutdown is correctly handled but the init's exit handler still gets
>>>> called and
>>>> dumps its callstack, that's not desirable because (in case of an
>>>> exception in
>>>> python code for example) part of the useful information on the
>>>> screen is
>>>> scrolled out of view.
>>>> ---
>>>
>>> Note that there still will be kernel panic displayed and the machine
>>> won't react on ctrl-alt-del (VMWare). An endless sleepy loop could be a
>>> way out perhaps?
>>
>> Right, the loop is what used to be there. I kind of liked it but it
>> requires a separation of the two cases: loader returning with error vs.
>> s390 needing init to halt. If nobody has any real need for waiting at
>> this point any longer, we could alternatively call performReboot for all
>> cases of rebootAction, even for HALT.
>> (See also
>> https://www.redhat.com/archives/anaconda-devel-list/2010-January/msg00317.html)

> I'm not an shutdown expert, but we don't want to call performReboot in
> the HALT case, that would make it the same as POWEROFF: not good because
> we wouldn't be able to see the final output (in the frequent case of
> loader SIGSEGV for example), as you mentioned in the second thread. The

>From the old times, I thought a halt without poweroff is possible. At
least that was the case before APM and ACPI came into play. Calling
"halt" or "shutdown -H" should explicitly enforce a halt without
poweroff (whereas a "shutdown -h" could also poweroff is supported by
the system).

> loop could be one option, possibly with conditional code for S390 --
> what do you think David?

Sounds good to me.

> BTW Steffen, how does one halt the Linux kernel?

According to "man 2 reboot", this would halt as opposed to poweroff a
system:
LINUX_REBOOT_CMD_HALT
  (RB_HALT_SYSTEM, 0xcdef0123; since 1.1.76).  The message ‘System
  halted.’ is printed, and the system is halted.  Control is given
  to the ROM monitor, if there is  one.   If  not  preceded  by  a
  sync(2), data will be lost.

I haven't tested this but I suppose the performReboot could be extended
as follows and then called dependently for s390 (compile time ifdef or
maybe even cleaner: a new -H option for the standalone shutdown binary
and passing this flag by means of a compile unit global static variable
to shutDown so we don't have to change its interface and thus callers in
init.c. For the latter approach we would change "shutdown" to "shutdown
-H" in linuxrc.s390 to explicitly trigger a non-interactive halt.)

> static void performReboot(reboot_action rebootAction) {
> 	if (rebootAction == POWEROFF) {
>         printf("powering off system\n");
> 		sleep(2);
>         reboot(RB_POWER_OFF);
> 	} else if (rebootAction == REBOOT) {
> 		printf("rebooting system\n");
> 		sleep(2);
> 
> #if USE_MINILIBC
> 		reboot(0xfee1dead, 672274793, 0x1234567);
> #else
> 		reboot(RB_AUTOBOOT);
> #endif
> 	}
        else if (rebootAction == HALT) {
          printf("halting system\n");
          sleep(2);
          reboot(RB_HALT_SYSTEM);
        }
> }

(From a style point of view, a switch case construct would be nicer than
the else if cascade.)

Steffen

Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux