Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 12/4/83; site rlgvax.UUCP Path: utzoo!watmath!clyde!burl!mgnetp!ihnp4!houxm!houxz!vax135!cornell!uw-beaver!tektronix!hplabs!hao!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.unix-wizards,net.bugs.usg Subject: Why does the S5 init run "/bin/su" instead of "/bin/sh" single-user? Message-ID: <2045@rlgvax.UUCP> Date: Thu, 21-Jun-84 22:28:13 EDT Article-I.D.: rlgvax.2045 Posted: Thu Jun 21 22:28:13 1984 Date-Received: Wed, 27-Jun-84 08:47:12 EDT Organization: CCI Office Systems Group, Reston, VA Lines: 32 Somebody asked me why the System V "init" runs "/bin/su" instead of "/bin/sh" as the single-user shell, pointing out that running "/bin/su" requires a valid entry for "root" in "/etc/passwd" while running "/bin/sh" doesn't. The idea of single-user mode was that providing a usable shell in that mode should require as few parts of UNIX to be working as possible; obviously, the root file system must be somewhat usable, and "/etc/init", "/dev/console", and "/bin/sh" must be usable (and possibly some of the funny links the S5 "init" uses to refer to "/dev/console"), and "/.profile" mustn't have a problem, but it shouldn't require anything else other than, of course, the commands you wish to run. The only reasons I can think of are: 1) They want "su" to log the super-user shell in "/usr/adm/sulog". 2) They want "su", which is run as "su -", to do all the things that an "su -" does, like a "chdir" to "root"'s home directory (which is useless unless it isn't "/"), setting the environment including PATH (which "/etc/init" could do itself), etc.. As far as I'm concerned, none of those reasons override the desire to have a single-user shell assume that as little of the system works as possible, so that you can fix it without having to restore the root file system. You aren't supposed to do much in single-user mode, anyway. A good system won't even linger in single-user mode when booted; it'll check the file systems and go right to multi-user mode (or whatever you call "fully up" mode on a single-user workstation). Anybody got a good reason which overrides even that desire? Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy