Re: halt: init exits/panic

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

 



On 10/4/05, Nico Schottelius <[email protected]> wrote:
> Coywolf Qi Hunt [Sun, Jul 10, 2005 at 01:09:22AM +0800]:
> > On 7/9/05, Nico Schottelius <[email protected]> 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/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux