Description
While executing restart_syncd.yml , the script was trying to execute the below command and expecting the process to be killed in output. But the command is fail to kill the syncd process.
utdown --cold264f-03:/home/admin# docker exec -i syncd /usr/bin/syncd_request_shu
requested COLD shutdown
root@sonic-z9264f-03:/home/admin# pgrep "<syncd>" -a
8396 /bin/bash /usr/local/bin/syncd.sh wait >>>>>>>>>>>>>>
8400 /bin/bash /usr/bin/syncd.sh wait
From script expectations
-
name: Stop syncd process
shell: docker exec -i syncd /usr/bin/syncd_request_shutdown --cold -
name: Wait 10 seconds for syncd to quit
pause:
seconds: 10 -
name: Look for syncd process
shell: pgrep "<syncd>" -a
register: syncd_out
ignore_errors: yes -
debug: msg="{{ syncd_out.stdout_lines }}"
-
fail: msg="Syncd is still running?"
when:- ({{ syncd_out.stdout_lines | length }} > 0)