The cumin service script did not correctly detect the termination of the cumin master process, rather it assumed that the service exited almost immediately after a SIGTERM was issued to the cumin master process. This was not always true, since the cumin child processes might take seconds to shutdown gracefully.
In the case of a restart, the cumin service would not always be restarted. When the 'start' command was issued too soon after the 'stop', the service might still be running from the first invocation and the init.d script would simply return "OK". This could be true in the case of the 'restart' command or in the case of 'stop' and 'start' issued in sequence.
The cumin service script now checks the status of the cumin master process after issuing a SIGTERM. If the service does not shutdown within a timeout (5 seconds), the service script will note that the service may not have shutdown completely and will not remove the pidfile. This allows the service 'status' command to be used to check the process status. Existence of a pidfile without a running service indicates a crash or a prolonged shutdown; check /var/log/cumin/master.log for shutdown messages. Failure to shutdown within the timeout is highly unlikely.
The cumin service 'stop' command will not return OK until the service has been stopped or the timeout has expired. Additionally, the cumin child processes and the cumin master process should guarantee their own exits, making zombie processes extremely unlikely.
Shutdown and restart of the cumin service should now be very reliable.