I am currently working on a linux daemon that needs to be single instance (i.e restricted to 1 user 1 process). What would be the best way of doing so without having to use getpid() to manually write the pid out to /var/run/ and then lock it using flock()?
I am currently working on a linux daemon that needs to be single instance
Share
Just lock the executable file itself.