Why pid file is needed for service in linux?
Hi,
Just some questions from a linux newbie about service files.
For example I was looking at sshd service file.
Q-1. What is the use of service.pid file like sshd.pid? Why I need to write PID inside this file?
Q-2 I am writing a service file for Jboss Server and when I issue restart command for the service, I encountered the race problem (I grep the PID and write into the PID file and in case of restart two PID appear in the PID file instead of one ). Restart in my case is:
restart)
stop
start
if I put a sleep of 3 then it works fine. But just wondering is the only solution or do need to do something else to avoid race?
TIA,
Sachin
|