From a729ea1a59b63c5f3e7fdce6a6c4e2ce12faa972 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 11 Sep 2018 14:24:47 +0900 Subject: [PATCH] man: document RUNTIME_DIRECTORY= or friends (cherry picked from commit d491e65e74a92898d6e7f95032b5b037c6e3cb60) Related: #2049788 --- man/systemd.exec.xml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index 696438c4ef..dc88cf9781 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -820,15 +820,18 @@ CapabilityBoundingSet=~CAP_B CAP_C These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include ... If set, one or more directories by the specified names will be created (including their parents) below the locations - defined in the following table, when the unit is started. + defined in the following table, when the unit is started. Also, the corresponding environment variable + is defined with the full path of directories. If multiple directories are set, then int the environment variable + the paths are concatenated with colon (:). - Automatic directory creation - + Automatic directory creation and environment variables + Locations for system for users + Environment variable @@ -836,26 +839,31 @@ CapabilityBoundingSet=~CAP_B CAP_CRuntimeDirectory=/run$XDG_RUNTIME_DIR + $RUNTIME_DIRECTORY StateDirectory= /var/lib $XDG_CONFIG_HOME + $STATE_DIRECTORY CacheDirectory= /var/cache $XDG_CACHE_HOME + $CACHE_DIRECTORY LogsDirectory= /var/log $XDG_CONFIG_HOME/log + $LOGS_DIRECTORY ConfigurationDirectory= /etc $XDG_CONFIG_HOME + $CONFIGURATION_DIRECTORY @@ -905,7 +913,13 @@ CapabilityBoundingSet=~CAP_B CAP_C/run/foo/bar, and /run/baz. The directories /run/foo/bar and /run/baz except /run/foo are owned by the user and group specified in User= and Group=, and removed - when the service is stopped. + when the service is stopped. + + Example: if a system service unit has the following, + RuntimeDirectory=foo/bar +StateDirectory=aaa/bbb ccc + then the environment variable RUNTIME_DIRECTORY is set with /run/foo/bar, and + STATE_DIRECTORY is set with /var/lib/aaa/bbb:/var/lib/ccc.