[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/profile.d



> In linux.debian.devel, you wrote:
> >I noticed an /etc/profile.d directory in RH distribution.
> >
> >I think it is good idea. Some packages require to set correct environment
> >variables, etc.
> >
> >i.e qt1 requires QTDIR=/usr/lib/qt1g variable. It could be set by
> >/etc/profile.d/qt1g.sh conffile.
> >
> >Another example - a choise of default language in /etc/profile.d/lang.sh file.
> >
> >It is very simple to implement this feature in /etc/profile:
> >
> >for i in /etc/profile.d/*.sh; do
> >    . $i
> >done  
> >
> >Of course, Debian Policy tells 
> >
> >"No program may depend on environment variables to get reasonable
> >defaults. (That's because these environment variables would have to be
> >set in a system-wide configuration file like /etc/profile, which is
> >not supported by all shells.)"
> >
> >but I think this directory could be useful in some cases.

True. No program may depend on environment variables but quite often
sysadmins want to do it. So let's have a standard way to do things.

> Figure out how to do it with the rest of the shells...

I have a debian package which implements a profile.d for sh, bash and
csh. Any other shell can be handled in the same way. You can find it
at the following url:

  http://www.cs.unitn.it/~dz/debian/packages/shellrc_1.0.deb

This mechanism could be used by packages who need initializations at
login time, for example sendfile, or by sysadmins who want to setup a
default environment for their users. Users can later redefine them.

-- 
Massimo Dal Zotto

+----------------------------------------------------------------------+
|  Massimo Dal Zotto               email: dz@cs.unitn.it               |
|  Via Marconi, 141                phone: ++39-0461534251              |
|  38057 Pergine Valsugana (TN)      www: http://www.cs.unitn.it/~dz/  |
|  Italy                             pgp: finger dz@tango.cs.unitn.it  |
+----------------------------------------------------------------------+


Reply to: