11

I'm quite new in Linux world, and now I'm trying to understand FHS principles.

In /var/run I found about ten *.pid files like crond.pid which contain just PIDs.

There are more than ten processes running in the system and just ten files.

So what is their purpose and what generated them?

1 Answers1

14

The purpose of these files is to provide an easy means for other processes to communicate with them (e.g. send signals). This only makes sense for long running services, that’s why you find much less such files than processes running.

Usually those files are created by the service they represent, you will find a parameter like --pid-file or so in the invocation.

Depending on the type of init-system you will find files for services in different places.

  • sysv-init: /etc/init.d/
  • upstart: /etc/init/
  • systemd: /etc/systemd/
guntbert
  • 1,637