Filesystem Hierarchy Standard

5.13 /var/run : Run-time variable data

5.13.1 Purpose

This directory contains system information data describing the system since it was booted. Files under this directory must be cleared (removed or truncated as appropriate) at the beginning of the boot process. Programs may have a subdirectory of /var/run; this is encouraged for programs that use more than one run-time file.[footnote 37]

5.13.2 Requirements

The internal format of PID files remains unchanged. The file must consist of the process identifier in ASCII-encoded decimal, followed by a newline character. For example, if crond was process number 25, /var/run/crond.pid would contain three characters: two, five, and newline.

Programs that read PID files should be somewhat flexible in what they accept; i.e., they should ignore extra whitespace, leading zeroes, absence of the trailing newline, or additional lines in the PID file. Programs that create PID files should use the simple specification located in the above paragraph.

The utmp file, which stores information about who is currently using the system, is located in this directory.

Programs that maintain transient UNIX-domain sockets must place them in this directory.

[37] /var/run should be unwritable for unprivileged users (root or users running daemons); it is a major security problem if any user can write in this directory. Process identifier (PID) files, which were originally placed in /etc, must be placed in /var/run. The naming convention for PID files is <program-name>.pid. For example, the crond PID file is named /var/run/crond.pid.


Previous: /var/opt : Variable data for /opt
Next: /var/spool : Application spool data
Up: Table of Contents

Translated by troff2html v1.5 on 29 March 2002 by Daniel Quinlan