Re: run-parts for /etc/profile?
Marc Haber <Marc.Haberemail@example.com> wrote:
> Debian relies heavily on run-parts which I consider a very useful
> tool to aid packages in installing extensions to standard config
> files like cron.daily. For me, the logical step would be having an
> /etc/profile containing something like run-parts /etc/profile.d and
> having packages install their environment changes etc. in special
> scripts in /etc/profile.d.
> Is there a special reason why this hasn't been done?
Because the Debian policy tells us:
3.8. Environment variables
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.)
If a program should depend on environment variables for its
configuration, the program has to be changed to fall back to a
reasonable default configuration if these environment variables are
not present. If this cannot be done easily (e.g., if the source code
of a non-free program is not available), the program should be
replaced by a small `wrapper' shell script which sets the environment
variables and calls the original program.
Here is an example of a wrapper script for this purpose:
exec /usr/lib/foo/foo "$@"
Furthermore, as `/etc/profile' is a configuration file of the `bash'
package, no other package may put any environment variables or other
commands into that file.
* Internet: firstname.lastname@example.org * Fido: 2:2450/42 *
PGP: 1024/DD08DD6D 2D E7 CC DE D5 8D 78 BE 3C A0 A4 F1 4B 09 CE AF