Subject: Re: how to get to single-user mode?
To: James Wetterau <jwjr@name.net>
From: Perry E. Metzger <perry@piermont.com>
List: netbsd-help
Date: 11/23/1998 14:23:59
James Wetterau writes:
> I was unable to find out how to bring a running system down to single
> user mode cleanly in the man pages or FAQ's, other than the suggestion
> that I:
> 
> kill -s TERM 1
> 
> from the init(8) man pages.  

That should indeed work, as should using shutdown(8) with the proper
flags.

> I tried this last night after patching my kernel and it didn't seem to
> work.  The system simply stopped responding to the keyboard entirely.
> I waited for about 45 seconds and then reset my machine.

Hmmm....

1) Were you running X at the time?
2) You may have had to wait longer than you expected.
3) There may in fact be a real problem.

> It rebooted
> quickly and the new kernel came up without any problems, except that
> fsck fixed up some trouble in the superblocks.  This happened of
> course because I was planning to fsck from single user mode, as
> recommended in the section on kernel tuning of the UNIX SA Handbook
> 2nd Edition by Nemeth, Snyder, Seebass and Hein, and since I never got
> to single-user mode I never got a chance to do so.

BTW, "boot -s" from the i386 boot prompt will bring you to single user 
mode on boot.

> So, I'm wondering, what's the right way, if there is one, to take the
> machine down to single-user mode?

you did the right thing already with init(8) -- or there's shutdown(8) 
as I mentioned.

> Also, if the man pages are
> incorrect, whom do I report that to to get them fixed?

The man page is right. You're having some sort of problem.

> Also, is my system buggy if kill -s TERM init doesn't work?
> Finally, could this be a byproduct of having replaced /netbsd with
> the new /netbsd before the kill?

No. It would have had no impact. After boot, /netbsd isn't used for
much any longer except for symbol grovelling.

> Going down to single user mode after replacing the old
> kernel with the new one is the recommended procedure for BSD system in
> the SA Handbook, but possibly that information is inaccurate for
> NetBSD?

There's nothing wrong with doing it that way, although I don't see why 
one would particularly want to. NetBSD administration isn't
particularly different from SunOS or 4.4BSD administration in most of
these particular respects, btw.

Perry