Wofür sind PID- und Sperrdateien?

Ich sehe oft, dass Programme pid- und lock-Dateien angeben. Und ich bin mir nicht ganz sicher, was sie tun. Zum Beispiel beim Kompilieren von nginx: --pid-path=/var/run/nginx.pid \ --lock-path=/var/lock/nginx.lock \ Kann jemand etwas Licht auf dieses