As the indexers and search heads are in cluster and on Unix OS, whenever there is a proper shutdown or reboot of servers is there any command or script which can tell Unix to use bin/splunk stop command.
For now I think Unix uses kill -9 before kernel is shutdown so I think there might be some alternative to stop Splunk gracefully.
Thanks for your reply J. I found in the docs that firing the reboot or shutdown command Splunk stops itself gracefully.
Also I found command to stop and start it with particular user name. Thanks for the link and clearing my doubts.