I tack onto /etc/profile a line which sources my "local profile master"
/local/profile.d/<hostname>.sh
which in turn sources a list of applicable scripts based on user/group/...
(ie root, or eng group, or regular users, ...)
/local/profile.d/functions
/local/profile.d/pathfunctions
/local/profile.d/java.sh
/local/profile.d/oracle.sh
/local/profile.d/<project.sh>
/local/profile.d/netscape.sh
/local/profile.d/informix.sh
and so on.
The primary "trick" required here is defining a set of
PATH, CDPATH, and CLASSPATH component variables
and supporting pathfunctions which allow each script to append/prepend or replace
the appropriate pieces of the PATH, CLASSPATH, etc.
I used my own /local/profile.d so I had my own namespace and so I could
override "defaults" installed by various apps into /etc/profile.d
Further, I have found it a lot easier to upgrade and migrate to new versions when
this (and other) purely local configuration information is separate from /etc/
(and /usr/local).
In addition, a lot of these scripts are more organization or application oriented and can be readily copied to multiple machines.
I also keep backup copies in /local/etc of the handful of files that change in /etc, (and the like). I then write /local (and a couple other directories eg. /java, /db) to a CD-RW or another machine. If/when I need to reinstall and/or build a similar workstation, I install stock, restore /local, copy to /etc, (and the like) and I'm up and running.
R.Parr
Temporal Arts
Paul Hamm wrote:
I handle this the same way. I agree that it is more extensable for
corporate wide system configurations. On a one off system it may be easier
to use /etc/profile but maintaining a large number of machines each with a
slightly different /etc/profile is just a PITA.
-----Original Message-----
From: Robert P. J. Day [mailto:rpjday@mindspring.com]
Sent: Sat, November 23, 2002 11:16 AM
To: psyche mailing list
Subject: system-wide configuration for user accounts
i'm curious about how people set up system-wide config
for user accounts on their hosts, as i'm designing the account admin chapter for my migration web site and i want
to make sure i give good advice.
once upon a time, an admin would add sys-wide stuff in
/etc/profile, to affect everyone.
these days, we have the /etc/profile.d/*sh directory
structure. while newly-installed RPMs are certainly free
to add RPM-specific files here that will be consulted upon
login, i also like to throw extra stuff in here related
to the app manually; eg., when i added sun's j2sdk package,
i manually added a "java.sh" file to that directory which
extended the search PATH.
is this considered acceptable behavior? to just manually
toss extra files in there? it certainly is a cleaner and
more modular approach than constantly hacking /etc/profile.
rday
Robert P. J. Day, RHCE, RHCI
Eno River Technologies, Chapel Hill NC
Unix, Linux and Open Source corporate training
http://www.linux-migration.org
-- Psyche-list mailing list Psyche-list@redhat.com https://listman.redhat.com/mailman/listinfo/psyche-list