Set environment variable globally
Andrew Martin
amartin at xes-inc.com
Wed Apr 5 18:30:17 UTC 2017
----- Original Message -----
> From: "Gérard BIGOT" <gerard.bigot at gmail.com>
> To: "amartin" <amartin at xes-inc.com>
> Cc: "ubuntu-devel-discuss" <ubuntu-devel-discuss at lists.ubuntu.com>
> Sent: Friday, March 31, 2017 8:41:36 AM
> Subject: Re: Set environment variable globally
> Hi,
>
> I added this line in /etc/environment since a long time :
>
> TZ="Europe/Paris"
>
> It gives me satisfaction.
>
> With this line, upon reboot, I have :
>
> ~$ echo $TZ
> Europe/Paris
>
> Without TZ doesn't exist.
>
Gérard,
I can't seem to get this to work on 16.04. Which shell are you using?
Have you customized your /etc/bash.bashrc or /etc/profile to source
/etc/environment? I don't see any mention of /etc/environment in the
bash manpage, so it seems like this file isn't being used. Also, how
can I make this environment variable available to all processes started
by upstart (14.04) and systemd (16.04)? I am concerned not only about
interactive processes but also scripts (e.g. started via cron) and
services (started via upstart or systemd).
Thanks,
Andrew
More information about the Ubuntu-devel-discuss
mailing list