[plug] /sbin and static programs

Bernard Blackham bernard at blackham.com.au
Wed Mar 10 21:52:33 WST 2004


On Wed, Mar 10, 2004 at 09:40:41PM +0800, James Devenish wrote:
> > After reading of Kimberly's woes, I looked in /sbin and was surprised
> > to see (ldd /sbin/*) that most programs there were dynamically linked.
> >   I _had_ thought the whole point of /sbin was for static binaries. Now it
> > seems to be for sysadmin tools. Did I just make a big wrong assumption,
> > or has it evolved?
> 
> BSDs tend to treat /sbin as though it stands for "static binaries"
> rather than "system binaries", but SysV treats is less like that.

>From my experience, BSDs use /sbin for system binaries still, but
more specifically, the contents of /bin and /sbin must be statically
linked. Their counterparts /usr/bin, /usr/sbin and /usr/local/bin,
etc, can be dynamically linked. I always imagined the reasoning was
so there was a usable system on /, should /usr fail to mount.

I'd also imagine that in Linux, the binaries in /bin and /sbin, even
though dynamically linked, should only be dynamically linked to
things in /lib and not /usr/lib, for similiar reasons. On my system,
/bin appears to satisfy that criterion, but some /sbin binaries
don't - namely cramfs utils, smb utils, netware utils, and vconfig
(for vlans).

Bernard.

Disclaimer: the above is from memory only. I may have read it
somewhere. I may have made it up and thought it made good sense. I
may be completely wrong :)

-- 
 Bernard Blackham <bernard at blackham dot com dot au>



More information about the plug mailing list