Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 2615 - use /etc/profile.local
Summary: use /etc/profile.local
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-09 10:06 UTC by Markus Krainer
Modified: 2003-02-04 19:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Krainer 2002-05-09 10:06:22 UTC
Please add

if [ -e "/etc/profile.local" ]
then
  source /etc/profile.local
fi

somewhere to /etc/profile to be able to have some settings, aliases, etc. 
that not get overwritten by portage.

  -Markus-
Comment 1 Bart Lauwers (RETIRED) gentoo-dev 2002-05-09 11:12:32 UTC
If you try adding a file with your settings to /etc/env.d and then running
env-update you will find /etc/profile.env has your settings.... does this meet
your need?
Comment 2 Markus Krainer 2002-05-09 12:05:56 UTC
No, because I do not only have environment vars but also some aliases.
Furthermore I want some settings only for root with "if [ whoami .. ]".

I know I can also set this kind of settings in ~/.bash_profile, but I
(and I think others too) find it convenient to have some settings for all
users in one file.

So it is not a *must* feature but a *would-be-nice-to-have* feature, and I
think it doesn't get in the way because if you don't have a need for a
/etc/profile.local then simply don't make one.

  -Markus-
Comment 3 Andreas Simon 2002-06-14 16:25:35 UTC
This profile.local is nice but there is something better:  # Source profile scripts for i in /etc/profile.d/*.sh ; do         if [ -x $i ]; then                 . $i         fi done  Then create a dir /etc/profile.d/ and put there your .sh scripts and make them executable. BTW, that's the way Mandrake and Redhat do it. 
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-06-17 14:43:01 UTC
Solution from Andreas Simon is the best in my opinion up to date.  It also
fits in nicely with our /etc/env.d/ and /etc/modules.d/ schemes.

Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2002-06-24 18:30:28 UTC
Lets maybe just think about this again.  I nearly never have a generic
/etc/profile, but add whatever to it.  Generally you should not need to
worry about it being replaced.  This is the whole idea behind the ._cfg*
files ... you can have your own config without worrying that the package
management system will loose your changes.  If it does get fried with baselayout
releases, it could be a bug in portage that we need to fix.

Also have a look at etc-update in app-admin/gentoolkit for a easy way
to update ._cfg* files.
Comment 6 Markus Krainer 2002-06-26 17:37:31 UTC
If I rethink the whole thing, I think the only reason I asked for this 
"feature" is because I'm used to it from other (old-fashioned) distros.
But as you stated, there isn't really a need for this as the config protection 
should take care of my personal settings in /etc/profile and makes 
profile.local obsolete.

Thanks for enlightenment ;)

  -Markus-