The strangeness called `sbin'

Peter Wemm peter at
Thu Nov 10 17:33:24 UTC 2011

On Thu, Nov 10, 2011 at 9:16 AM, Ed Schouten <ed at> wrote:
> Hi Peter,
> * Peter Wemm <peter at>, 20111110 17:56:
>> Of course, that pales in comparison to the impact of adding
>> /usr/local/bin to the path, but it does show this does have potential
>> user visibility.  And there's also the issue that most most users add
>> every possible directory to their $PATH anyway.
> Exactly. Also, there are shells nowadays that cache all binaries in PATH
> up front, such as zsh. When they start, they loop through all dirents in
> all directories in $PATH and add it to a big cache. This entirely
> defeats this purpose.

I use tcsh and zsh, I'm aware of this cache.

However, libc doesn't, so things like /bin/sh when running shell
scripts do not.  make(1) does not.  People do still care about
buildworld time.  Simple things like changing gcc to static linking
were a few percentage points of buildworld time, back in the day.
Having /bin/sh as a static binary used to be 3%-5% of buildworld time,
simply because fork/exec was faster as the copy-on-write burden was
less.  This stuff adds up.

> I don't think that there are that many people who don't add /sbin and
> /usr/sbin to $PATH nowadays. I have colleagues of mine who use Linux
> systems that don't have this in their $PATH. When I ask them whether it
> causes problems for them, they deny, but it turns out they simply put
> `sudo' in front of it, to work around that, regardless of whether it was
> needed.

Having /sbin in $PATH where /sbin is a symlink to /bin would be worse
than having no /sbin at all, from a perspective of rootvnode lock
lifetime.  If you can figure out how to get people to remove /sbin and
/usr/sbin from their paths after the symlink changes then it becomes a
moot point.  But heck, I still have /usr/X11R6 in mine... :(

Peter Wemm - peter at; peter at; peter at; KI6FJV
"All of this is for nothing if we don't go to the stars" - JMS/B5
"If Java had true garbage collection, most programs would delete
themselves upon execution." -- Robert Sewell

More information about the freebsd-arch mailing list