export variable inheritance question

Garrett Cooper yanegomi at gmail.com
Fri Oct 2 23:58:35 BST 2009


On Fri, Oct 2, 2009 at 3:41 PM, Garrett Cooper <yanegomi at gmail.com> wrote:
> Hi Scott,
>    We recently ran into a slightly unexpected side-effect where we
> exported a variable in a jobfile, like so:
>
> # job1
> env VAR=1
> export VAR
>
> # job2
> start on job1
>
>    And $VAR was visible from job2 with the value set in job1 (in this
> case $VAR => 1). Is that intended behavior?
>    My group is still stuck with 0.5.0, BTW...
> Thanks,
> -Garrett
>
> [o:~]$ start job1
> [o:~]$ cat /etc/init/jobs.d/job*
> env VAR=1
> export VAR
> console output
> start on started job1
> exec env > job2.env
> [o:~]$ cat /job2.env
> TERM=linux
> VAR=1
> PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:NONE/sbin
> PWD=/
> JOB=job1
> SHLVL=0
> UPSTART_INSTANCE=
> UPSTART_EVENTS=started
> UPSTART_JOB=job2
> INSTANCE=

    Hmmm... it works as I expect when I don't use env and instead use
export VAR=1. Interesting...
-Garrett



More information about the upstart-devel mailing list