systemd private temp configuration.. a word of caution

Latest response

For anyone that is using the private temp (/tmp) feature, a word of caution. If something removes the directory that is created by systemd in /tmp, systemd continues to behave like the private temp directory exists, and you get some strange behaviour from the application/service that is using the private /tmp (eg. it is told the directory exists.. but can't access it).

The only way I have found to resolve this issue is to restart the service that utilises the private temp, and a new private temp directory will be created.

To determine if you are using private temps, you can look in the systemd service file

[Service]
PrivateTmp=true

Or look in your /tmp directory and the service name is included in the tmp directory

ls -lad /tmp/systemd-private*
/tmp/systemd-private-<random string>-<servicename>.service-<random string>

Responses