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

Re: Where is the documentation for /etc/environment?



>> there is no debian documentation/policy about
>>environment/profile.
>>In fact there is a "war" between maintenair about who set what
>>(only for the
>>PATH variable as far as i know).
>>Thus you cannot set the PATH var in /etc/environment and expect
>>it to be used
>> by all apps (shells, cron dameon, gdm , ... overwrite it all the
>>time).

>Debian policy 9.9:
>
>9.9 Environment variables
>
>A program must not 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 usually depends on environment variables for its
>configuration, the program should 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
>must be replaced by a small "wrapper" shell script which sets the
>environment variables if they are not already defined, and calls
>the original program.
>
>Here is an example of a wrapper script for this purpose:
>
>     #!/bin/sh
>     BAR=${BAR:-/var/lib/fubar}
>     export BAR
>     exec /usr/lib/foo/foo "$@"

What are you trying to explain ?

"must be replaced by a small "wrapper" shell script which sets the
environment variables if they are not already defined," Not
already defined mean not already defined that s all. If i set
PATH in login.defs, bash should not overwrite it .

>Furthermore, as /etc/profile is a configuration file of the
>base-files package, other packages must not put any environment
>variables or other commands into that file"
what are you talking about. Commands in /etc/profile are meant
for bash and a few other bourne shells. Be they in base-files that does
not prevent it from being tweaked for bash.

If you wanted to tell that the policy explain how debian manage
environment variable I don't get your point of view.
THe policy says that program should not depend on environment
variable to be already defined (for example JAVA_HOME for a java
program to start).
This does not tell anything on how it should manage environment
variables that are defined !

As i told previously , we end up with wrapper of conffile and
shell that overwrite PATH . It has nothing to do with the policy
telling that if the variable is not defined, the debian version
of the program should use a default one.

Cheers
Alban




Reply to: