public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: halt: init exits/panic
  2005-07-09 15:12 halt: init exits/panic Nico Schottelius
@ 2005-07-09 14:26 ` DervishD
  2005-07-09 17:09 ` Coywolf Qi Hunt
  1 sibling, 0 replies; 7+ messages in thread
From: DervishD @ 2005-07-09 14:26 UTC (permalink / raw)
  To: Nico Schottelius, linux-kernel

    Hi Nico :)

 * Nico Schottelius <nico-kernel@schottelius.org> dixit:
> What's the 'correct behaviour' of an init system, if someone wants
> to shutdown the system?

    What I do in my vcinit, the last steps I mean, is:

    reboot(RB_POWER_OFF); /* If halting*/
        or
    reboot(RB_AUTOBOOT); /* If rebooting */

    exit(EXIT_SUCCESS);

    And my vcinit doesn't panic ;)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* halt: init exits/panic
@ 2005-07-09 15:12 Nico Schottelius
  2005-07-09 14:26 ` DervishD
  2005-07-09 17:09 ` Coywolf Qi Hunt
  0 siblings, 2 replies; 7+ messages in thread
From: Nico Schottelius @ 2005-07-09 15:12 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

Hello!

What's the 'correct behaviour' of an init system, if someone wants
to shutdown the system?

I currently do:

- call reboot(RB_POWER_OFF/RB_AUTOBOOT/RB_HALT_SYSTEM)
- _exit(0)

Is this exit() call wrong? If I do RB_HALT_SYSTEM and _exit(0) after,
the kernel panics.

Should init simply sleep, return to normal processing or exit?

Sincerly,

Nico

-- 
Keep it simple & stupid, use what's available.
Please use pgp encryption: 8D0E 27A4 is my id.
http://nico.schotteli.us | http://linux.schottelius.org

[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: halt: init exits/panic
  2005-07-09 15:12 halt: init exits/panic Nico Schottelius
  2005-07-09 14:26 ` DervishD
@ 2005-07-09 17:09 ` Coywolf Qi Hunt
  2005-10-04  7:30   ` Nico Schottelius
  2005-10-04  7:37   ` Nico Schottelius
  1 sibling, 2 replies; 7+ messages in thread
From: Coywolf Qi Hunt @ 2005-07-09 17:09 UTC (permalink / raw)
  To: Nico Schottelius, linux-kernel

On 7/9/05, Nico Schottelius <nico-kernel@schottelius.org> wrote:
> Hello!
> 
> What's the 'correct behaviour' of an init system, if someone wants
> to shutdown the system?
> 
> I currently do:
> 
> - call reboot(RB_POWER_OFF/RB_AUTOBOOT/RB_HALT_SYSTEM)
> - _exit(0)
> 
> Is this exit() call wrong? If I do RB_HALT_SYSTEM and _exit(0) after,
> the kernel panics.

What the panic shows?
-- 
Coywolf Qi Hunt
http://ahbl.org/~coywolf/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: halt: init exits/panic
  2005-07-09 17:09 ` Coywolf Qi Hunt
@ 2005-10-04  7:30   ` Nico Schottelius
  2005-10-04  7:37   ` Nico Schottelius
  1 sibling, 0 replies; 7+ messages in thread
From: Nico Schottelius @ 2005-10-04  7:30 UTC (permalink / raw)
  To: coywolf; +Cc: Nico Schottelius, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

Sorry for the delay.

Coywolf Qi Hunt [Sun, Jul 10, 2005 at 01:09:22AM +0800]:
> On 7/9/05, Nico Schottelius <nico-kernel@schottelius.org> wrote:
> > Hello!
> > 
> > What's the 'correct behaviour' of an init system, if someone wants
> > to shutdown the system?
> > 
> > I currently do:
> > 
> > - call reboot(RB_POWER_OFF/RB_AUTOBOOT/RB_HALT_SYSTEM)
> > - _exit(0)
> > 
> > Is this exit() call wrong? If I do RB_HALT_SYSTEM and _exit(0) after,
> > the kernel panics.
> 
> What the panic shows?

"Attempted to kill init!"

--> Panic.

Nico


-- 
Latest project: cconfig (http://nico.schotteli.us/papers/linux/cconfig/)
Open Source nutures open minds and free, creative developers.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: halt: init exits/panic
  2005-07-09 17:09 ` Coywolf Qi Hunt
  2005-10-04  7:30   ` Nico Schottelius
@ 2005-10-04  7:37   ` Nico Schottelius
  2005-10-04  8:12     ` Coywolf Qi Hunt
  1 sibling, 1 reply; 7+ messages in thread
From: Nico Schottelius @ 2005-10-04  7:37 UTC (permalink / raw)
  To: coywolf; +Cc: Nico Schottelius, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

Coywolf Qi Hunt [Sun, Jul 10, 2005 at 01:09:22AM +0800]:
> On 7/9/05, Nico Schottelius <nico-kernel@schottelius.org> wrote:
> > Hello!
> > 
> > What's the 'correct behaviour' of an init system, if someone wants
> > to shutdown the system?
> > 
> > I currently do:
> > 
> > - call reboot(RB_POWER_OFF/RB_AUTOBOOT/RB_HALT_SYSTEM)
> > - _exit(0)
> > 
> > Is this exit() call wrong? If I do RB_HALT_SYSTEM and _exit(0) after,
> > the kernel panics.
> 
> What the panic shows?

To be fully correct:

"Kernel panic - not syncing: Attempted to kill init" (from the last time
I tried, 2.6.13.2)

Perhaps _exit(0) is not correct for an init system?
This at least explains why it always looks like nothing is synced.

Nico

-- 
Latest project: cconfig (http://nico.schotteli.us/papers/linux/cconfig/)
Open Source nutures open minds and free, creative developers.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: halt: init exits/panic
  2005-10-04  7:37   ` Nico Schottelius
@ 2005-10-04  8:12     ` Coywolf Qi Hunt
  2005-10-04 10:55       ` Nico Schottelius
  0 siblings, 1 reply; 7+ messages in thread
From: Coywolf Qi Hunt @ 2005-10-04  8:12 UTC (permalink / raw)
  To: Nico Schottelius; +Cc: linux-kernel

On 10/4/05, Nico Schottelius <nico-kernel@schottelius.org> wrote:
> Coywolf Qi Hunt [Sun, Jul 10, 2005 at 01:09:22AM +0800]:
> > On 7/9/05, Nico Schottelius <nico-kernel@schottelius.org> wrote:
> > > Hello!
> > >
> > > What's the 'correct behaviour' of an init system, if someone wants
> > > to shutdown the system?
> > >
> > > I currently do:
> > >
> > > - call reboot(RB_POWER_OFF/RB_AUTOBOOT/RB_HALT_SYSTEM)
> > > - _exit(0)
> > >
> > > Is this exit() call wrong? If I do RB_HALT_SYSTEM and _exit(0) after,
> > > the kernel panics.
> >
> > What the panic shows?
>
> To be fully correct:
>
> "Kernel panic - not syncing: Attempted to kill init" (from the last time
> I tried, 2.6.13.2)
>
> Perhaps _exit(0) is not correct for an init system?
> This at least explains why it always looks like nothing is synced.

Right. init(8) should not call _exit() or exit(). Otherwise you'll get
that panic. It's OK for *another* process, reboot(8) to call reboot(2)
and then exit(). You should follow this way.
--
Coywolf Qi Hunt
http://sosdg.org/~coywolf/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: halt: init exits/panic
  2005-10-04  8:12     ` Coywolf Qi Hunt
@ 2005-10-04 10:55       ` Nico Schottelius
  0 siblings, 0 replies; 7+ messages in thread
From: Nico Schottelius @ 2005-10-04 10:55 UTC (permalink / raw)
  To: Coywolf Qi Hunt; +Cc: Nico Schottelius, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1462 bytes --]

Coywolf Qi Hunt [Tue, Oct 04, 2005 at 04:12:40PM +0800]:
> On 10/4/05, Nico Schottelius <nico-kernel@schottelius.org> wrote:
> > Coywolf Qi Hunt [Sun, Jul 10, 2005 at 01:09:22AM +0800]:
> > > On 7/9/05, Nico Schottelius <nico-kernel@schottelius.org> wrote:
> > > > Hello!
> > > >
> > > > What's the 'correct behaviour' of an init system, if someone wants
> > > > to shutdown the system?
> > > >
> > > > I currently do:
> > > >
> > > > - call reboot(RB_POWER_OFF/RB_AUTOBOOT/RB_HALT_SYSTEM)
> > > > - _exit(0)
> > > >
> > > > Is this exit() call wrong? If I do RB_HALT_SYSTEM and _exit(0) after,
> > > > the kernel panics.
> > >
> > > What the panic shows?
> >
> > To be fully correct:
> >
> > "Kernel panic - not syncing: Attempted to kill init" (from the last time
> > I tried, 2.6.13.2)
> >
> > Perhaps _exit(0) is not correct for an init system?
> > This at least explains why it always looks like nothing is synced.
> 
> Right. init(8) should not call _exit() or exit(). Otherwise you'll get
> that panic. It's OK for *another* process, reboot(8) to call reboot(2)
> and then exit(). You should follow this way.

Ok, as far as I understood my init simply returns to its normal state
and hopes that the kernel halts|reboots|powers off.

Will do that' thanks for the info.

Nico

-- 
Latest project: cconfig (http://nico.schotteli.us/papers/linux/cconfig/)
Open Source nutures open minds and free, creative developers.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-10-04 10:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-09 15:12 halt: init exits/panic Nico Schottelius
2005-07-09 14:26 ` DervishD
2005-07-09 17:09 ` Coywolf Qi Hunt
2005-10-04  7:30   ` Nico Schottelius
2005-10-04  7:37   ` Nico Schottelius
2005-10-04  8:12     ` Coywolf Qi Hunt
2005-10-04 10:55       ` Nico Schottelius

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox