Bug 1464065

Summary: [WALA] "waagent -configuration-path:/path -start" not take effect
Product: Red Hat Enterprise Linux 6 Reporter: Yuhui Jiang <yujiang>
Component: WALinuxAgentAssignee: Vitaly Kuznetsov <vkuznets>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.9CC: borisb, brendand, danis, hkrijger, jopoulso, leiwang, mmorsy, stephen.zarkos, wshi, yujiang, yuxisun
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-24 09:31:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1451174    
Bug Blocks:    

Description Yuhui Jiang 2017-06-22 11:18:44 UTC
Description of problem:
I've ran the command "waagent -configuration-path:/path -start",but the parameter "-configuration-path" not take effect.
This will affect WALA running on RHEL6.x
(Because on RHEL6.x, execute WALA service through "serivce waagent start",it will invoke /etc/init.d/waaget.And in this file,execute WALA through "waagent -start",so this will affect WALA)

below is code in agent.py

220 def start():
221     """
222     Start agent daemon in a background process and set stdout/stderr to
223     /dev/null
224     """
225     devnull = open(os.devnull, 'w')
226     subprocess.Popen([sys.argv[0], '-daemon'], stdout=devnull, stderr=devnull)


Version-Release number of selected component (if applicable):
WALinuxAgent-2.2.12-1

How reproducible:
100%

Steps to Reproduce:
1.Prepare a RHEL6.9 VM on Azure with WALA-2.2.12-1 installed
2.Modify WALA init file(/etc/init.d/waagent),add "-configuration-path:/root/waagent" on line#19,like this "$WAZD_BIN -configuration-path:/root/waagent.conf -start",save and exit
3.Restart WALA service    #service waagent restart
4.Check WALA process  #ps aux | grep waagent

Actual results:
[root@wala69test1 ~]# ps aux | grep waagent
root     38459  0.6  0.6 203908 11212 pts/0    S    06:40   0:00 python /usr/sbin/waagent -daemon
root     38466  1.5  0.8 367988 13864 pts/0    Sl   06:40   0:00 python -u /usr/sbin/waagent -run-exthandlers




Expected results:
[root@walayjgrhelrun2 ~]# ps aux | grep waagent
root     21280  1.8  0.1 222104 13060 ?        Ss   18:43   0:00 /usr/bin/python -u /usr/sbin/waagent -configuration-path:/root/waagent.conf -daemon
root     21285  4.5  0.2 382588 18236 ?        Sl   18:43   0:00 python -u /usr/sbin/waagent -run-exthandlers -configuration-path:/root/waagent.conf



Additional info:

Comment 2 Mohammed Gamal 2017-06-23 08:55:41 UTC
Fixed in v.2.2.14
https://github.com/Azure/WALinuxAgent/releases/tag/v2.2.14

Comment 3 Yuhui Jiang 2017-07-06 10:40:19 UTC
Verified this issue on RHEL-7.4 with WALinuxAgent-2.2.14-1.el6.noarch.rpm pass.
The issue has solved.

Verify Steps:
 #refer this issue's Description

Comment 4 Yuxin Sun 2017-07-24 09:31:35 UTC
Close this issue because WALinuxAgent-2.2.14-1.el7/6 has shipped.