bashrc fix

Kok, Auke sofar at foo-projects.org
Tue Mar 6 16:52:04 CET 2007


Dennis Veatch wrote:
> On Tuesday 06 March 2007 07:50:51 am Dennis Veatch wrote:
>> On Tuesday 06 March 2007 07:47:46 am Zbigniew Luszpinski wrote:
>>> Tuesday 06 of March 2007 05:09:26 Kok, Auke wrote:
>>>> Zbigniew Luszpinski wrote:
>>>>> lunar changelog:
>>>>> *if PATH was exported earlier, preserve its content (e.g.
>>>>> /etc/profile loads earlier),
>>>> PATH is *ALWAYS* set earlier, e.g. cron sets it, bash itself does so as
>>>> well.
>>>>
>>>> The way that you implemented this it will *add* existing values to it,
>>>> making them appear double. that is not right.
>>> That was my intention. Preserve path variable instead of erasing it with
>>> path settings hardcoded to bashrc. Possible fixes:
>>>
>>> 1) If they are really double why not removing redundand path variable
>>> from bashrc? Exporting several times the same variable renders it hard to
>>> improve in the future (having to remember all the places where it was
>>> hardcoded).
>>>
>>> 2) To protect against double defining we could save path variable content
>>> to file and maintain it using sed or other text editor. Everytime someone
>>> needs to export path it could read it from file (like e.g. /etc/LOCALE).
>>> Thanks to this I could tolerate (ugly imho) path hardcoding in many
>>> files.
>> What about /etc/skel ? Isn't that there just for this sort of thing or am I
>> confused?
> 
> On second thought that probably wouldn't be a good idea. Users would then have 
> to edit whatever in /etc/skel (I think) and that would be painfull on a 
> server. As I understand it.

we have the following method to change stuff for users:

1) /etc/profile.d - for both SA provided new defaults and distro settings
2) the SA can modify /etc/profile and /etc/bashrc
3) /etc/skel/* for *new* users, modified by SA
3) ~/.bashrc and ~/.bash_profife directly modifyable by the user

the philospohy here is that PATH additions go to /etc/profile.d. the SA can add 
a system-wide lang.rc to /etc/profile.d or just modify /etc/profile, and bashrc 
is kept to a bare minimum at all times.

hth,

Auke


More information about the Lunar mailing list