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

Bug#2916: sysvinit & single boot == broken



Package: sysvinit
Version: 2.60-1

Quick Summary
-------------

sysvinit runs way too much crap when booting in single user mode.

The tale of woe
---------------

I had a nasty HD crash on my gw machine (i still haven't tracked down
the exact cause), leaving me with a /usr file system which fsck -A could
not repair.

When I rebooted, the automatic fsck failed, and I was given a prompt to
enter the root password for single user mode to run fsck manually.

I entered the password. bash started up, some error messages from either
/etc/profile or ~/.bashrc came up (regarding programs on /usr which
couldn't be run) -- this is a bug.

bash should NOT source init files like /etc/profile in this situation!
There is a command line option "-noprofile" to bash to force this
behaviour.

The system rebooted.  Before giving me a prompt.  I have no idea why
this happened (maybe because the exit code of the last program executed
from /etc/program was non-zero?).  Hence I was unable to run fsck.  This
is another bug.

When the LILO prompt came up again, I entered "linux single" to force
single user mode.  Imagine my surprise when "fsck -A" started running
again.  At this point I had a nasty sinking feeling, knowing that
without a lot of stuffing around I wasn't going to be able to get a
prompt.

THERE WAS NO POSSIBLE WAY FOR ME TO GET A SHELL PROMPT WHICH I COULD HAVE
USED TO REPAIR MY /USR PARTITION!

SINGLE is supposed to just drop you into a shell without doing anything
fancy, without running anything.


To make things even worse, I didn't have a boot/root emergency repair
disk.  This is my own stupid fault.  My bug, to be fixed ASAP.  Also, my
mirror of debian was on the gw machines /usr partition...I couldn't even
install the boot-floppies package to make a set of install disks.

I had a copy of the old debian 0.93r6 install disks, so i tried booting
on that.  The root disk for that set doesn't even have fsck!!!  Doesn't
have ls or hardly anything useful either. I'd report that as a bug too,
but that version is obsolete and I haven't checked whether it's fixed in
the new version.

I wasted some more time hunting around on my Nov 95 Infomagic CD looking
for rescue disk sets. found a few things, but they were all a.out or
seemed like they would take several hours to hack into shape.  I'll
investigate the latest versions of these now that my net link is back
up again...I'm going to be making a rescue disk for myself, so I'll
probably release something as a debian package .

A happy ending
--------------

I finally got my /usr partition fixed when I realised that I could
reformat my swap partition as e2fs, install the base debian 0.93r6 disks
there, reboot, and run fsck.  That got me a shell prompt, I fixed the
partition, and rebooted again.  Then I ran "init S" and unmounted /usr
and ran fsck again (just in case the new version 1.02 could fix things
which the old version in deb0.93 couldn't fix). rebooted again, and it's
been OK ever since.

This would be a nightmare for a novice user.  It was bad enough for me
and i've been hacking on unix & linux systems for several years.


Recommendations
---------------

sysvinit should be changed to just give me a damned shell when i boot in
single user mode.  That's what single mode is for.  If I wanted all that
extra crap to be run then i'd boot normally!

When the system is booted in "single" mode, init should do nothing but
load update/bdflush and any other *essential* daemons, and then run a
shell prompt on tty1.  If a user needs more than that, then they can
easily load them by hand.  And maybe spawn a few gettys on tty2 & tty3.

Craig

PS: no offence intended, you'll have to excuse the tone of this message.
if you think i'm pissed off now just writing about it, you should have
seen me when i was in the middle of this mess.


Reply to: