For one service I need a couple directories available inside /tmp
. But I also want to use systemd's PrivateTmp=yes
. Is there something like AssertPathExists=/tmp/x
that also creates the path?
edit: some more clarity
systemd's privateTmp creates a blank /tmp
every time the process starts.
Some processes need directories that can be in /tmp
but the configuration should point to existing ones, and the process will not create them to avoid assuming (wrongly) ownership/permissions/etc.
for example, you might have a httpd server which the config file requires you to point to a 'session storage dir', which you may want to place in /tmp
. But if your configuration says /tmp/httpd-session
then startup will fail, because /tmp
was just created empty before the process starts.