[BUG] walinuxagent does not read environment variable PATH
See original GitHub issueI updated the PATH variable on my VM, but the walinuxagent seems not to pick up the changes, and uses and odd value for it. Steps followed:
- update system-wide PATH by modifying
/etc/environment
- restart the VM
If I ssh into the machine and perform the following commands:
sudo su
(to impersonate the userroot
)echo $PATH
the returned value is correct.
If I execute echo $PATH
in Azure Portal through the ‘Run command’ panel of the VM, a different value is returned in the output (different even from the one before I made the change).
I also executed the commands whoami
(to be sure I am using the same user root
in both cases) and more /etc/environment
(to check that the right value is still there).
I tried to re-install and restart the agent, but not difference in the outcome.
- Distro and Version: Ubuntu 16.04 (Data Science Machine)
- WALinuxAgent version. Output of
waagent --version
: WALinuxAgent-2.2.32.2 running on ubuntu 16.04 Python: 3.5.2 Goal state agent: 2.2.40
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
cloud-init does not appear to be running error after installing ...
Decided to create a blank Linux VM to see the agent configuration of it, within /var/lib/waagent folder there was ovf-env.xml – had a...
Read more >Azure Devops - Environment variable $Path is overwritten via ...
This line of code set the environment variable $env:Path!!!! So now Azure Devops can't find any executables. I get this error message.
Read more >Unable to configure the PATH environment variable in Kudu ...
I have seen posts like setting the webapp %PATH% environment variable in azure. The post recommends adding a file called applicationHost.xdt to ...
Read more >Chapter 6. RHEL 8.1.0 release Red Hat Enterprise Linux 8
Network drivers typically read multiple PCI registers, and the driver does not read the lowest bits of the PHC time stamp between two...
Read more >Custom Azure VM Scale Sets with Terraform and Cloud Init
Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My hypothesis is that the later two path variables (
/usr/games:/usr/local/games
) were added after the service (/usr/bin/python3 -u /usr/sbin/waagent -daemon
) started. And the service never got it (becuase of our configuration of the unit file - eg: Ubuntu does not have environment key in the service section.)This is an issue, especially if the environment variables are not being picked up. I will test it with 18.04 VMs as well.
@vrdmr , thanks a lot for the hard work! Hope 18.04 doesn’t show this behavior and that the Data Science Machine will be updated to that version.