> (1) Try to start it twice. The second start attempt should fail and $? should reflect that Nope, according to https://refspecs.linuxfoundation.org/LSB_2.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html the second attempt should do nothing and indicate success. Attached a new version (moved pid file from /var/lock to /var/run ).