Right. Most programs save a lock file in /var/run/X.pid where they actually save their PID. In their scripts, they first check for the existence of the file. If it doesn't exist, it is created, the PID is written to it and the file is locked and unlinked (an unlink is not able to take effect until the the last descriptor linked to that file is removed). The advantage of this is that it is much easier to find and stop a certain program without searching the process tables which are potentially very long). Also, if you start up a double of the script, it can offer optionally to kill or send any other various signal to the PID in the file as a quick form of IPC. If the process accidentally dies, the descriptor to the file is deleted, so the file can be unlinked. It's best to use such a "standard" way to manage larger apps like servers so that they cannot possibly interfere with each other.