Re: [PATCH 3/3] Handle reboot better on s390 (#533198)

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

 



This modifies the behavior of installer shutdown, if loader returned
with an error to init, on *all* platforms if I understand the code
correctly. Primarily because the sigint handler is no more there. The
function shutDown() is not just called from the standalone shutdown
binary but also from init.c.
Wasn't there a reason to have this handler at least for all platforms
besides s390?
E.g. to give the user time to do problem determination in case anaconda
or loader returned with error to init?

One more specific comment below.

On 01/19/2010 03:43 AM, David Cantrell wrote:
> Do not install a handler for SIGINT on s390 since you can't really press
> Ctrl+Alt+Del there.  Only handle SIGUSR1 and SIGUSR2 as handled in
> linuxrc.s390 (which comes from loader which comes from iutil.py).
> Always make sure we unmount filesystems and kill off processes, then
> reboot if that's requested or exit and display the halt message.
> ---
>  loader/shutdown.c |   29 ++++++-----------------------
>  1 files changed, 6 insertions(+), 23 deletions(-)
> 
> diff --git a/loader/shutdown.c b/loader/shutdown.c
> index 8f2c55e..7ab8195 100644
> --- a/loader/shutdown.c
> +++ b/loader/shutdown.c
> @@ -84,36 +84,19 @@ static void performReboot(reboot_action rebootAction) {
>  	}
>  }
> 
> -int shouldReboot = 0;
> -
> -static void rebootHandler(int signum) {
> -    shouldReboot = 1;
> -}
> -
>  void shutDown(int doKill, reboot_action rebootAction) {
> -	if (rebootAction == POWEROFF || rebootAction == REBOOT) {
> +	if (doKill) {
>  		performUnmounts(doKill);
>  		performTerminations(doKill);
> -		if (doKill)
> -			performReboot(rebootAction);
>  	}
> 
> -	if (!shouldReboot && rebootAction != REBOOT)
> -		printf("you may safely reboot your system\n");
> -	
> -    signal(SIGINT, rebootHandler);
> -	while (1) {
> -		if (shouldReboot) {
> -			performUnmounts(1);
> -			performTerminations(1);
> -			performReboot(REBOOT);
> -		}
> -		sleep(1);
> +	if ((rebootAction == POWEROFF || rebootAction == REBOOT) && doKill) {
> +		performReboot(rebootAction);
>  	}
> 
> -    exit(0);
> -
> -    return;
> +	printf("you may safely reboot your system\n");
> +	exit(0);
> +	return;

When called to shutdown/halt, it still won't halt the Linux kernel. It
would be nice if it cleanly did, because this would drop you into into a
state of z/VM on s390x where the user can easily enter a manual IPL
without any escaping tricks on the 3270 console (which are needed if the
guest OS still runs).

>  }
> 
>  #ifdef AS_SHUTDOWN

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