Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

/etc/profile.d or /usr/local/etc?

3 views
Skip to first unread message

David Chmelik

unread,
Jan 7, 2024, 1:56:36 AMJan 7
to
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)? I'm talking
about case of personal desktop/laptop usage in which I'm the only user but
have more than one username I want these on (don't discuss don't do this
on multi-user systems because I already know and set them in ~/.profile,
etc.).

Alastair Hogge

unread,
Jan 8, 2024, 1:16:56 AMJan 8
to
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

Grant Taylor

unread,
Jan 9, 2024, 10:28:32 PMJan 9
to
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. . . .
0 new messages