I have been using the following way to kill a process manually
ps -ef | grep process
kill -9 process id of process
start the process again
But i think how to do it programmitically as in write in a shellscript i just have to run e.g. ./restartProcess.sh
Thanks