[systemd-devel] PrivateTmp and systemd-tmpfiles

Lukáš Nykrýn lnykryn at redhat.com
Wed Oct 17 05:16:53 PDT 2012


Hello,
Today I have read this bug
https://bugzilla.redhat.com/show_bug.cgi?id=866693 and described
systemd-tmpfiles behavior look pretty wrong to me, but I am not sure how
to fix it. Some ideas cross my mind; moving systemd-namespace-*
elsewhere, adding some option to exclude dirs in tmpfiles conf files,
stop cleaning /tmp, hardcode some excludes to tmpfiles, but I don't like
any of these solutions.

Smaller reproducer:
/usr/lib/tmpfiles.d/tmp.conf
d /tmp 1777 root root 20s
----
a.service
[Unit]
Description=unit %n
----
[Service]
Type=simple
ExecStart=/root/test.sh
StandardOutput=syslog
PrivateTmp=yes
----
/root/test.sh
#!/bin/bash
sleep 40
echo "hello world" > /tmp/xxx
exit 0

and then run something like
systemctl start a.service &
watch 'systemd-tmpfiles --clean tmp.conf; ls -al /tmp; systemctl status
a.service'

Regards
Lukas



More information about the systemd-devel mailing list