Created on 05-27-2015 04:08 AM - edited 09-16-2022 02:30 AM
I tried to use a script which start / stop CM agent. It's found that if the agent was started and then stopped, the script will be killed. As show below:
[root@cdh52 ~]# cat myscript.sh #!/bin/bash service cloudera-scm-agent start service cloudera-scm-agent stop echo "Still Alive" You have new mail in /var/spool/mail/root [root@cdh52 ~]# ./myscript.sh Starting cloudera-scm-agent: [ OK ] Stopping cloudera-scm-agent: Terminated
Note that [OK] and "Still Alive" is not displayed, because the parent script was killed when cloudera-scm-agent trying to stop the agent. The same effect if "service cloudera-scm-agent" was replaced by /etc/init.d/cloudera-scm-agent
What i don't understand is HOW kill find the parent processto kill. The cloudera-scm-agent script has already disown'ed the agent. And ps show that the PID of agent's parent is 1 (init), not myscript.sh.
Any suggestion?
Created 05-27-2015 09:15 PM
Resolved by upgrade coreutils to 8.4-37.el6 (CentOS 6.5 original version: 8.4-31.el6)
Created 05-27-2015 07:47 PM
Created 05-27-2015 08:36 PM
Thanks for the reply. It seems this is a general Linux issue when killing a "su" process (where agent is), not caused by CM.
Will update here when I get meaningful finding.
Created 05-27-2015 09:15 PM
Resolved by upgrade coreutils to 8.4-37.el6 (CentOS 6.5 original version: 8.4-31.el6)
Created 05-27-2015 09:17 PM