0

Possible Duplicate:
Reference for proper handling of PID file on Unix

Is the .pid file in unix created automatically by the operating system whenever a process runs OR should the process create a .pid file programmatically like "echo $$ > myprogram.pid" ?

Community
  • 1
  • 1
thewall
  • 15
  • 2
  • 8

1 Answers1

1

The latter holds true -- a process must create the .pid file (the OS won't do it). pid files are often used by daemon processes for various purposes. For example, they can be used to prevent a process from running more than once. They can also be used so that control processes (e.g. apache2ctl) know what process to send signals to.

nneonneo
  • 171,345
  • 36
  • 312
  • 383