• Re: /etc/profile.d or /usr/local/etc?

    From Alastair Hogge@21:1/5 to David Chmelik on Mon Jan 8 06:16:51 2024
    On Sun, 07 Jan 2024 06:56:33 +0000, David Chmelik wrote:

    If one wants to set system-wide aliases, environment variables,
    functions,
    etc., I assume it's best to not alter /etc/profile rather than use /etc/ profile.d or perhaps somewhere in /usr/local/etc (where)?

    Have a look in /etc/profile[1]. On 14.x, and 15-CURRENT, you can make use
    of either /etc/profile.d or /usr/local/etc/profile.d, tho I would go with
    you inclination and leave /etc/ untouched, and prefer the /usr/local
    prefix.

    1: https://codeberg.org/FreeBSD/freebsd-src/src/branch/stable/14/bin/sh/ profile

    --
    To health and anarchy

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grant Taylor@21:1/5 to Alastair Hogge on Tue Jan 9 21:28:29 2024
    On 1/8/24 00:16, Alastair Hogge wrote:
    Have a look in /etc/profile[1]. On 14.x, and 15-CURRENT, you can
    make use of either /etc/profile.d or /usr/local/etc/profile.d, tho I
    would go with you inclination and leave /etc/ untouched, and prefer
    the /usr/local prefix.

    I have no overt objection to modifying files in /etc (or a sub-directory therein).

    I grew up with /usr/local being allocated to the local site and
    independent of the distribution. As such, /etc being outside of
    /usr/local runs the risk of having files replaced during upgrades.
    Though I would sincerely hope that there is effort to avoid this both on FreeBSD's part and the system administrators part.

    As for profile file vs the profile.d directory, I've learned that
    separate files inside of the profile.d directory are somewhat easier to maintain than the profile file. (Independent of /etc/profile* vs /usr/local/etc/profile* decision.) This simply has to do with the
    monolithic nature of the profile file vs the modular nature of the
    profile.d directory.

    In short, do whatever you want, just try to have an understanding of
    what you're doing.



    --
    Grant. . . .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)