From owner-freebsd-current@FreeBSD.ORG Mon Nov 17 12:59:49 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2CADB16A4CE for ; Mon, 17 Nov 2003 12:59:49 -0800 (PST) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED63E43F93 for ; Mon, 17 Nov 2003 12:59:47 -0800 (PST) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id D3C742A8EB; Mon, 17 Nov 2003 12:59:47 -0800 (PST) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: walt In-Reply-To: <3FB90579.8050204@myrealbox.com> Date: Mon, 17 Nov 2003 12:59:47 -0800 From: Peter Wemm Message-Id: <20031117205947.D3C742A8EB@canning.wemm.org> cc: freebsd-current@freebsd.org Subject: Re: HEADS UP: /bin and /sbin are now dynamically linked X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2003 20:59:49 -0000 walt wrote: > Terry Lambert wrote: > > "Robert M.Zigweid" wrote: > > > >>I'll admit to being mostly a lurker here, but isn't the point of /sbin > >>to be statically linked. That's what the 's' stands for? > >> > >>Second question. This seems to imply that /sbin and /bin both have to > >>have the same behavior? I have no problem with /bin being dynamically > >>linked, but what if I want /bin to be dynamic and /sbin static? > > > > > > Since sbin on System V predated shared libraries on System V, > > I think maybe this is a reverse assignment of a meaning to the > > 's'. > > I was taught by an older fart than Terry that the 's' stands for > (S)ingle-user, which is reflected even today in the 'boot -s' switch. > > Since the single-user is usually the Sysadmin, the association with > 'system' is inevitable. The association with 'static' is also > inevitable when I think of Sysadmins-I-Have-Known ;0) It is 'system' binaries. The distinction between bin and sbin (and /usr/ bin and /usr/sbin) is that the binaries in */sbin are only really supposed to be useful for administrators or other priviliged users. eg: ps, netstat, ls, id, etc are in */bin because they dont require privs and are generally useful. meanwhile, fsck, dhclient, fdisk, cron, rmuser, usbdevs etc do require priviliges or are not of general use. Why seperate them? Consider your shell and searching $PATH at execve time. It was more efficient to keep the amount of work that each step in processing $PATH to a minimum. Doubling the size of the directories means double the work searching directories looking for the "foo" binary. Remember that we dont have hashed directory lookups, its a linear search. For all your shell scripts etc, this search happens over and over and over again. So, having /bin:/usr/bin:/usr/local/bin as your $PATH as a normal user is a win. Of course, the nami cache which does negative caching does skew things a bit, but it still helps. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5