Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Apr 2015 18:34:57 +0200
From:      Polytropon <freebsd@edvax.de>
To:        FreeBSD FreeBSD <freebsd-questions@freebsd.org>
Subject:   Re: Path settings
Message-ID:  <20150408183457.0f928632.freebsd@edvax.de>
In-Reply-To: <20150408080410.437e58a9@seibercom.net>
References:  <20150408080410.437e58a9@seibercom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 8 Apr 2015 08:04:10 -0400, Jerry wrote:
> I have never understood which comes first in the path setting; "/usr/bin"
> or "/usr/local/bin". The same can be said for "/usr/sbin"
> and /usr/local/sbin".

System-level tools usually have higher priority, and
additionally installed software (which resides in /usr/local
subtrees per default).

Per-user installed software, as well as software not
managed by ports or pgk, can be put into ~/bin or /opt/bin,
but this typically requires additions to the configuration.



> The reason I am asking is because I have "openssl" installed from ports. If I
> have the former path setting and run "which openssl", the system openssl is
> reported. However, if I switch the path setting to the latter, and rerun the
> command, the port version of openssl is revealed.

This behaviour is logical and intended. Just imagine someone
would install a "ls 'replica'" which would do stupid or
nasty things... ;-)

The _first_ matching command found by looking at the $PATH
entries will be executed.

However, it's probably easier to get rid of the system's
OpenSSL tools if you're not intending to use them. Keep
in mind that certain scripts may redifine $PATH, so what
you expect in a user's CLI session might not apply when
you run scripts (or when the system runs them).



> I have "WITH_OPENSSL_PORT=yes" in the "/etc/make.conf" file if that makes any
> difference.

You can define WITHOUT_OPENSSL and maybe WITHOUT_OPENSSH
in /etc/src.conf to _not_ have them in the system, and
you will have to supply them as ports. ALso check the
ports options, it's possible that there's a configuration
switch (in "make config") that allows the port to install
files to the system-level directories (such as CUPS can
do, to replace the system's lp* tools).

See "man src.conf" for details.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150408183457.0f928632.freebsd>