title: How to detect a hung linux service?
body: <p>I have noticed on some of my linux servers that a linux service will be hung. The only way I know that it is hung is operations that rely on the service fails and when I restart the service it fails to stop but it starts fine. </p>
  
  <p>If I do <code>service &lt;servicename&gt; status</code> it says its running, If I do a <code>ps -ef | grep &lt;servicename&gt;</code> it only shows one process running for that service which is correct. </p>
  
  <p>Anything else I can check to know if it is hung or not? I am trying to be proactive about bringing these service(s) back up and also determining why they are getting hung. </p>
  
  <p>For reference the services are mostly openstack-nova-compute and openstack-cinder-volume. The cinder volume service I can detect with the rabbitMQ starting to build up but the same thing doesn't happen for nova-compute.</p>
  
  <p>This is very hard to test because like I said the only way I know is if I try to do something on that node in OpenStack and it fails or gets hung, and then I restart the service.</p>