[parisc-linux] Re: two minor c3k bugs
Helge Deller
deller@gmx.de
Sun, 2 Dec 2001 23:46:27 +0100
Hi Grant,
On Saturday 01 December 2001 07:11, Grant Grundler wrote:
> > Currently I use "kill_proc(1, SIGINT, 0);" to kill the init-process -
> > which is normally a reboot-command and gives the above messages.
>
> Ok. that makes sense.
>
> > That's AFAICS not the right solution, but nfortunately I don't know
> > how to do it correct right now.
>
> ./kernel/sys.c: printk(KERN_EMERG "Power down.\n");
>
> That chunk of code seems to do the right thing:
> case LINUX_REBOOT_CMD_POWER_OFF:
> notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF,
> NULL); printk(KERN_EMERG "Power down.\n");
> machine_power_off();
> do_exit(0);
> break;
>
> I know that msg since I regularly "powerdown" my c3k.
> Perhaps replicate that code?
Yes, that's the right code-path, but sadly calling this function
would immediately power off the computer without doing a nice
system shutdown.
I'll need to investigate how to first find the PID of the init process and
then how to tell it to shut down the system cleanly.
Helge
> cheers,
> grant