From f8c2f1b9618cda05c0b3b8e6201a4d34f579bfc0 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 1 Jan 2012 09:47:01 -0800 Subject: [PATCH] Significant rewording of /run, add a separate section Lift more of the properties of /run into normative text and state explicitly that the FHS requirements apply to /run and /run/lock. Add a new section explaining that packages cannot rely on structure in /run unless they've created it and saying explicitly that packages must not ship files in /run or /var/run or /var/lock. Reference that section from the init.d section. --- policy.sgml | 86 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 28 deletions(-) diff --git a/policy.sgml b/policy.sgml index f512315..fb9fd9f 100644 --- a/policy.sgml +++ b/policy.sgml @@ -6246,33 +6246,37 @@ install -m644 debian/shlibs.package debian/package/DEBIAN/ symlinked there, is relaxed to a recommendation.

+ +

+ The additional directory /run in the root + file system is allowed. /run + replaces /var/run, and the + subdirectory /run/lock + replaces /var/lock, with + the /var directories replaced by symlinks + for backwards compatibility. /run + and /run/lock must follow all of the + requirements in the FHS for /var/run + and /var/lock, respectively, such as file + naming conventions, file format requirements, or the + requirement that files be cleared during the boot + process. Files and directories residing + in /run should be stored on a temporary + file system. +

+

The following directories in the root filesystem are - additionally allowed: /run, - - The purpose of the /run hierarchy is storage of ephemeral - system state, that is, state information that should - not be preserved across a reboot. - Files and directories residing in /run - should be stored on a temporary filesystem. - The /run directory is a - replacement for /var/run; its - subdirectory /run/lock is a replacement for - /var/lock. - /run/ and /run/lock/ have been introduced - by most distributions and are on track to be - endorsed by the FHS. - Additionally, the subdirectory /run/shm - is a replacement for /dev/shm. - - /sys and /selinux. + additionally allowed: /sys + and /selinux. The /sys and /selinux directories are mount points where virtual filesystems are mounted which provide access to kernel information. +

@@ -6407,6 +6411,35 @@ rmdir /usr/local/share/emacs 2>/dev/null || true though the spool may still be physically located there.

+ + + /run and /run/lock + +

+ The directory /run is cleared at boot, normally + by being a mount point for a temporary file system. Packages + therefore must not assume that any files or directories + under /run other than /run/lock + exist unless the package has arranged to create those files or + directories since the last reboot. Normally, this is done by + the package via an init script. See + for more information. +

+ +

+ Packages must not include files or directories + under /run, or under the /var/run + or /var/lock paths that are replaced with + symlinks or bind mounts to /run for backwards + compatibility. +

+ +

+ Packages should use /run in preference + to /var/run and /run/lock in + preference to /var/lock. +

+
@@ -6781,17 +6814,14 @@ test -f program-executed-later-in-script || exit 0

- Files and directories under /run, including those - in directories /var/run and /var/lock - which are symlinks or bind mounts to subdirectories of - /run, are normally stored on a temporary + Files and directories under /run, including ones + referred to via the compatibility paths /var/run + and /var/lock, are normally stored on a temporary filesystem and are normally not persistent across a reboot. - Consequently, packages cannot assume that these files or - directories are present at system boot time. - Files and directories under /run must not be - included in packages; such files or directories - must be created dynamically, for example, in the - init.d script. + The init.d scripts must handle this correctly. + This will typically mean creating any required subdirectories + dynamically when the init.d script is run. + See for more information.

-- 2.39.2