Skip to content

Commit d03fb2a

Browse files
cmousesirainen
authored andcommitted
settings/syntax: Describe effect of %variables better
1 parent 842a8ce commit d03fb2a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docs/core/settings/syntax.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ However, you must be careful with the ordering of these in the configuration
436436
file, because the `$SET:variables` are expanded immediately while parsing the
437437
config file and they're not updated later.
438438

439+
See also [[link,settings_variables]].
440+
439441
## Environment Variables
440442

441443
It is possible use `$ENV:name` to expand values from environment.
@@ -447,3 +449,9 @@ Note that these are also Case Sensitive.
447449

448450
These can also be used for external config files, but you need to list them in
449451
[[setting,import_environment]] so that processes can see them.
452+
453+
For [[link,settings_types_file]] it is better to use `$ENV:` instead of `%{env:}`.
454+
This is because with `$ENV:` the expansion and file reading is done by the config
455+
process, which normally runs as root. With `%{env:}` the expansion is delayed
456+
until the process accessing the setting expands it, but the process may not
457+
have enough permissions to open the file.

docs/core/settings/types.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ the file permissions don't usually matter. However, some callers need to open
179179
the file again (e.g. the `ssl_client_cert_file` setting with MySQL) after
180180
the process has dropped root privileges.
181181

182-
The file paths do not support [[link,settings_variables,%variables]].
182+
If you use [[link,settings_variables,%variables]] in file names, the expansion
183+
is delayed until the process accessing the setting expands it. The process
184+
is usually not running as root at this point, so you may need to adjust file
185+
permissions.
183186

184187
It's possible to give inline values (instead of a path to a file) for the
185188
setting by using `inline:` prefix in the value. For example userdb could be

0 commit comments

Comments
 (0)