Skip to content

Commit a395599

Browse files
committed
Respect systemd's RUNTIME_DIRECTORY environment variable
Systemd will export the environment variable RUNTIME_DIRECTORY when running a deamon. This avoids the need for shipping a tmpfiles.d entry to create the run directory. Link: https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#RuntimeDirectory=
1 parent 77cc7a4 commit a395599

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/puppet/util/run_mode.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def public_dir
8181
end
8282

8383
def run_dir
84-
which_dir("/var/run/puppetlabs", "~/.puppetlabs/var/run")
84+
ENV.fetch('RUNTIME_DIRECTORY') { which_dir("/var/run/puppetlabs", "~/.puppetlabs/var/run") }
8585
end
8686

8787
def log_dir

0 commit comments

Comments
 (0)