From: Zbigniew Jędrzejewski-Szmek Date: Tue, 24 Dec 2013 15:21:45 +0000 (-0500) Subject: man,units: tmpfiles.d(5) cleanup X-Git-Tag: v209~662 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=ef72c1f06e2bc696a799cd31a1e0ed25cc999ea4 man,units: tmpfiles.d(5) cleanup Condition for /lib (necessary for split /usr) was missing from the unit. Some changes which were done in tmpfiles.d(5) were not carried over to systemd-tmpfiles(1). Also use markup where possible. --- diff --git a/man/systemd-tmpfiles.xml b/man/systemd-tmpfiles.xml index b90bd757e..c65636b0f 100644 --- a/man/systemd-tmpfiles.xml +++ b/man/systemd-tmpfiles.xml @@ -54,7 +54,9 @@ - systemd-tmpfiles OPTIONS CONFIGURATION FILE + systemd-tmpfiles + OPTIONS + CONFIGFILE systemd-tmpfiles-setup.service @@ -67,22 +69,20 @@ Description systemd-tmpfiles creates, - deletes and cleans up volatile and temporary files and + deletes, and cleans up volatile and temporary files and directories, based on the configuration file format and - location specified in - tmpfiles.d - 5 - . + location specified in + tmpfiles.d5. + If invoked with no arguments, it applies all directives from all configuration files. If one or more filenames are passed on the command line, only the directives in these files are applied. If only the basename of a configuration file is specified, - all configuration directories as specified in - tmpfiles.d - 5 - are searched for a matching file. + all configuration directories as specified in + tmpfiles.d5 + are searched for a matching file. @@ -108,12 +108,25 @@ - If this option is passed, all - files and directories marked with f, - F, d, D in the configuration files are - created. Files and directories marked with z, - Z have their ownership, access mode and security - labels set. + If this option is + passed, all files and directories + marked with f, + F, + w, + d, + D, + p, + L, + c, + b, + m in the + configuration files are created or + written to. Files and directories + marked with z, + Z, + m have their + ownership, access mode and security + labels set. @@ -127,9 +140,11 @@ If this option is - passed, all files and directories marked - with r, R in the configuration files - are removed. + passed, all files and directories + marked with r, + R in the + configuration files are + removed. diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml index 1c079f64b..331fd1b47 100644 --- a/man/tmpfiles.d.xml +++ b/man/tmpfiles.d.xml @@ -67,23 +67,32 @@ Configuration Format Each configuration file shall be named in the - style of <package>.conf. - Files in /etc/ override files - with the same name in /usr/lib/ - and /run/. Files in - /run/ override files with the same - name in /usr/lib/. Packages + style of + package.conf + or + package-part.conf. + The second variant should be used when it is desirable + to make it easy to override just this part of + configuration. + + Files in /etc/tmpfiles.d + override files with the same name in + /usr/lib/tmpfiles.d and + /run/tmpfiles.d. Files in + /run/tmpfiles.d override files + with the same name in + /usr/lib/tmpfiles.d. Packages should install their configuration files in - /usr/lib/. Files in - /etc/ are reserved for the local - administrator, who may use this logic to override the - configuration files installed by vendor packages. All - configuration files are sorted by their filename in - lexicographic order, regardless in which of the - directories they reside. If multiple files specify the - same path, the entry in the file with the lexicographically - earliest name will be applied, all all other conflicting - entries logged as errors. + /usr/lib/tmpfiles.d. Files in + /etc/tmpfiles.d are reserved for + the local administrator, who may use this logic to + override the configuration files installed by vendor + packages. All configuration files are sorted by their + filename in lexicographic order, regardless in which + of the directories they reside. If multiple files + specify the same path, the entry in the file with the + lexicographically earliest name will be applied, all + all other conflicting entries logged as errors. If the administrator wants to disable a configuration file supplied by the vendor, the @@ -93,10 +102,10 @@ same filename. The configuration format is one line per path - containing action, path, mode, ownership, age and argument + containing type, path, mode, ownership, age, and argument fields: - Type Path Mode UID GID Age Argument + #Type Path Mode UID GID Age Argument d /run/user 0755 root root 10d - L /tmp/foobar - - - - /dev/null @@ -109,12 +118,12 @@ L /tmp/foobar - - - - /dev/null f - Create a file if it does not exist yet (optionally writing a short string into it, if the argument parameter is passed) + Create a file if it does not exist yet. If the argument parameter is given, it will be written to the file. F - Create or truncate a file (optionally writing a short string into it, if the argument parameter is passed) + Create or truncate a file. If the argument parameter is given, it will be written to the file. @@ -127,32 +136,32 @@ L /tmp/foobar - - - - /dev/null d - Create a directory if it does not exist yet + Create a directory if it does not exist yet. D - Create or empty a directory + Create or empty a directory. p - Create a named pipe (FIFO) if it does not exist yet + Create a named pipe (FIFO) if it does not exist yet. L - Create a symlink if it does not exist yet + Create a symlink if it does not exist yet. c - Create a character device node if it does not exist yet + Create a character device node if it does not exist yet. b - Create a block device node if it does not exist yet + Create a block device node if it does not exist yet. @@ -174,11 +183,12 @@ L /tmp/foobar - - - - /dev/null as controlled with the Age parameter. Note that lines of this type do not influence the - effect of r or R lines. Lines - of this type accept + effect of r + or R lines. + Lines of this type accept shell-style globs in place of - normal path - names. + normal path names. + @@ -187,28 +197,31 @@ L /tmp/foobar - - - - /dev/null during cleaning. Use this type to exclude paths from clean-up as controlled with the Age - parameter. Unlike x, this + parameter. Unlike + x, this parameter will not exclude the - content if path is a directory, - but only directory itself. - Note that lines of this type do - not influence the effect of r - or R lines. Lines of this type - accept shell-style globs in - place of normal path - names. + content if path is a + directory, but only directory + itself. Note that lines of + this type do not influence the + effect of r + or R lines. + Lines of this type accept + shell-style globs in place of + normal path names. + r Remove a file - or directory if it - exists. This may not be used - to remove non-empty - directories, use R for - that. Lines of this type - accept shell-style globs in - place of normal path + or directory if it exists. + This may not be used to remove + non-empty directories, use + R for that. + Lines of this type accept + shell-style globs in place of + normal path names. @@ -308,11 +321,14 @@ L /tmp/foobar - - - - /dev/null The file access mode to use when creating this file or directory. If omitted or when set to -, the default is used: 0755 for - directories, 0644 for all other file - objects. For z, Z lines, if omitted or when set - to -, the file access mode will not be - modified. This parameter is ignored for x, r, - R, L lines. + directories, 0644 for all other file objects. + For z, Z + lines, if omitted or when set to + -, the file access mode + will not be modified. This parameter is + ignored for x, + r, R, + L lines. @@ -321,10 +337,15 @@ L /tmp/foobar - - - - /dev/null The user and group to use for this file or directory. This may either be a numeric user/group ID or a user or group name. If - omitted or when set to -, the default 0 (root) - is used. For z, Z lines, when omitted or when set to -, - the file ownership will not be modified. - These parameters are ignored for x, r, R, L lines. + omitted or when set to -, + the default 0 (root) is used. For + z, Z + lines, when omitted or when set to -, the file + ownership will not be modified. These + parameters are ignored for + x, r, + R, L + lines. @@ -357,28 +378,37 @@ L /tmp/foobar - - - - /dev/null When the age is set to zero, the files are cleaned unconditionally. - The age field only applies to lines starting with - d, D and x. If omitted or set to -, no automatic clean-up - is done. + The age field only applies to lines + starting with d, + D, and + x. If omitted or set to + -, no automatic clean-up is + done. If the age field starts with a tilde - character (~), the clean-up is only applied to - files and directories one level inside the - directory specified, but not the files and - directories immediately inside it. + character ~, the clean-up + is only applied to files and directories one + level inside the directory specified, but not + the files and directories immediately inside + it. Argument - For L lines determines the destination - path of the symlink. For c, b determines the + For L lines + determines the destination path of the + symlink. For c, + b determines the major/minor of the device node, with major and - minor formatted as integers, separated by :, - e.g. "1:3". For f, F, w may be used to specify - a short string that is written to the file, - suffixed by a newline. Ignored for all other - lines. + minor formatted as integers, separated by + :, e.g. + 1:3. For + f, F, + and w may be used to + specify a short string that is written to the + file, suffixed by a newline. Ignored for all + other lines. diff --git a/units/systemd-tmpfiles-setup.service.in b/units/systemd-tmpfiles-setup.service.in index 6f9806374..3405e2842 100644 --- a/units/systemd-tmpfiles-setup.service.in +++ b/units/systemd-tmpfiles-setup.service.in @@ -14,6 +14,7 @@ Conflicts=shutdown.target After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target Before=sysinit.target shutdown.target ConditionDirectoryNotEmpty=|/usr/lib/tmpfiles.d +ConditionDirectoryNotEmpty=|/lib/tmpfiles.d ConditionDirectoryNotEmpty=|/usr/local/lib/tmpfiles.d ConditionDirectoryNotEmpty=|/etc/tmpfiles.d ConditionDirectoryNotEmpty=|/run/tmpfiles.d