How to reboot from start scripts?

Josef Wolf jw at raven.inka.de
Wed Sep 12 15:04:15 UTC 2007


On Thu, Sep 13, 2007 at 12:07:51AM +1000, James Takac wrote:
> On Wednesday 12 September 2007 15:48:13 Josef Wolf wrote:
> > I noticed that shutdown from scripts in /etc/rcS.d don't really work.
> >
> > For example, when fsck for some filesystems fails at startup, you
> > are thrown into a shell to fix the problem.  From that shell, you
> > have no chance to make a proper reboot.  I have tried:
> >
> >   - shutdown -r now
> >   - init 6
> >   - reboot
> >   - halt
> >
> > It don't really make a difference how I try to reboot.  I alwas get
> > thrown out and the boot process continues.  Finally I get the login
> > prompt.  But I did _not_ want to continue the boot.  I said I want
> > to _shutdown_.  Why is this ignored?
> >
> > Any ideas what I am missing here?  How do I properly reboot from
> > a script in /etc/rcS.d?
> 
> Not sure if it makes any difference in this instance but I now the reboot 
> needs admin privilages so you usually see sudo reboot rather than reboot on 
> its own

Start scripts are run as root, so no sudo is needed for any operation.
In particular, you are dropped into a root shell when fsck finds any
problems.

No, sudo don't make any difference, sonce you have root provileges
anyway.




More information about the ubuntu-users mailing list