I found Cloudera uses agent.py which is installed under /usr/lib64/cmf/agent/src/cmf/agent.py. In this python script, it has a Proess class to stop start roles such as datanode, nodemanger etc. This is in CM 5.5
But I found the agent.py is no longer under /usr/lib64/cmf/agent/src/cmf/agent.py but under /usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.9.0-py2.6.egg/lib/cmf/ and
And cannot found the Process class in those agent.py anymore.
So how does agent.py in CM 5.9 manage the roles? We need to moify the code to do some checks before starting a role.