rc.d prevent multiple start?

Hello,

I have a custom rc.d script to start a program. I run service xxx start to launch the program. However, if I run the command again it will launch a second instance of the program. I feel like there must be a simple way to prevent this, but I am having trouble finding it.

Thanks.
 
Nevermind, my fault! I forgot I implemented a custom start_cmd which did not check if the process is currently running.

All is good now.
 
Back
Top