How to reboot from start scripts?

Josef Wolf jw at raven.inka.de
Tue Oct 9 14:31:07 UTC 2007


On Tue, Oct 09, 2007 at 01:43:42PM +0100, Andrew Glen-Young wrote:
> On 09/10/2007, Josef Wolf <jw at raven.inka.de> wrote:
> > > > So there is really no way to properly shutdown/reboot from single-user
> > > > mode?
> >   - shutdown -r now
> >   - init 6
> >   - reboot
> >   - halt
> >   - ctrl-alt-del
> >   - CTRL-D
> >
> > _none_ of them reboots the system.  They all just continue the boot
> > process on a half-mounted system.  All of them (except CTRL-D) just leave
> > the single-user-shell running.  The result is that the single-user-shell
> > races with getty/login for input from /dev/tty1.
> 
> I missed the beginning of this thread, but your problem does not seem
> to be correct behaviour (or at least behaviour that I would expect).
> 
> I have tested your scenario with the only machine that I have the
> luxury of rebooting at the moment: Dapper LTS server. I can confirm
> that Dapper Server does not have this issue. I could reboot the server
> in all the ways listed above without issue.

Thanks for your efforts to reproduce the problem, Andrew!  Are you really
sure you were on the single-user-shell that is started when fsck notices
a problem at bootup?  If so, then it is indeed a new defect.  And since
upstart was introduced in Edgy AFAIK, it seems to be likely that this
problem is related to upstart.

Please note that once the boot is finished, all the commands mentioned
above start to work properly.  The problem only exists while the scripts
in /etc/rcS.d are executed at startup.

> I could not induce the rescue shell like you suggested (by editing the
> 'checkfs.sh' file).

I edited checkroot.sh, not checkfs.sh.  I have no clue whether checkroot.sh
already existed in Dapper, though.

> I had to pass the 'rootfatal=yes' commands from
> the 'kernel' command on the grub boot menu.

Ough, I don't get thrown into the single-user-shell this way.  I used
the 'e' key to edit the commands, then the 'e' key to edit the "kernel"
line, then appended "rootfatal=yes" to this line.

I also tried to open a new line with the 'o' key and put "rootfatal=yes"
into this new line.  But with this, I get an immediate reset (that is,
the bios starts to count the memory again).

Did you do something different to get into the rescue shell from grub?

> I might have time to try this on other flavours at a later time. What
> version of Ubuntu are you running?

I first noticed it on edgy when I built my own preseeded install-cd which
needed reboots during the install process in order to get a new kernel
running.  Currently, I have Feisty and experience the same (IMHO broken)
behavior.




More information about the ubuntu-users mailing list