Thanks Andreas for the quick answer. 

On 06/07/2018, 12:16, "Andreas Koeltringer" <andreas.koeltrin...@n-fuse.co> 
wrote:

    Because systemd does not read environment files from .bashrc. It has its 
    own way of getting environment files.
    
    Have a look at the systemd unit file doc [1]. Look out for 
    "Environment=" and "EnvironmentFile=" directives.
    
    Another possibility would be to set the env vars systemwide (e.g. in 
    /etc/environment) - this however is distribution-dependent.
    
    
    [1] https://www.freedesktop.org/software/systemd/man/systemd.service.html
    
    
    

Kaxil Naik 

Data Reply
2nd Floor, Nova South
160 Victoria Street, Westminster
London SW1E 5LB - UK 
phone: +44 (0)20 7730 6000
k.n...@reply.com
www.reply.com
On 07/06/2018 12:35 PM, Naik Kaxil wrote:
    > Hi guys,
    > 
    > I have recently setup Airflow on a new VM with system integration. I 
    > have added some environment variables in my bash_rc file for airflow 
    > user. Now when I try to run a BashOperator by first starting airflow 
    > using `airflow webserver -D` and `airflow scheduler -D` it seem to have 
    > access to that environment variables.
    > 
    > But if I use `systemctl start airflow-webserver`, and run the same 
    > operator, there is no output for the same environment variables.
    > 
    > And I am unable to figure out why is that the case.
    > 
    > Regards,
    > 
    > Kaxil
    > 
    > 
    > 
    > Kaxil Naik
    > 
    > Data Reply
    > 2nd Floor, Nova South
    > 160 Victoria Street, Westminster
    > London SW1E 5LB - UK
    > phone: +44 (0)20 7730 6000
    > k.n...@reply.com <mailto:k.n...@reply.com>
    > www.reply.com
    > 
    > Data Reply
    
    -- 
    Andreas Koeltringer
    Mail:   andreas.koeltrin...@n-fuse.co
    
    
    
    

Reply via email to