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: