[systemd-devel] systemd-tmpfiles for the user instance of systemd

Daniel Tihelka dtihelka at gmail.com
Wed Jul 1 03:35:26 PDT 2015


Hello,
does anyone have an experience with the use of systemd-tmpfiles for the user 
instance of systemd.

I ended with the following files (all copied from system service definitions and 
adjusted):

* systemd-tmpfiles-setup.service:

[Unit]
DefaultDependencies=no

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/systemd-tmpfiles --create --remove --root=%h 
%h/.config/tmpfiles.conf

[Install]
WantedBy=default.target

* systemd-tmpfiles-clean.service:

[Unit]
DefaultDependencies=no

[Service]
Type=oneshot
ExecStart=/usr/bin/systemd-tmpfiles --clean --root=%h %h/.config/tmpfiles.conf
IOSchedulingClass=idle

* systemd-tmpfiles-clean.timer 

[Unit]
Description=

[Timer]
OnUnitActiveSec=1d

[Install]
WantedBy=default.target



Well, it work, at least.

What I have found is that:

* man mentions that CAP_ADMIN is required to prevent bump of access time on 
directories, which may prevent their removal. It is OK for me, if it is valid 
for dirs only

* I have to specify the config file manually (i.e. %h/.config/tmpfiles.conf). 
There is no attempt to search for e.g. ~/.config/tmpfiles.d/ or 
/etc/tmpfiles.d/user/ directories when running in user mode. Is that correct?

* I have either use full paths in the config file (e.g. d /home/me/...) or to 
use --root switch (where still the paths in config must start with /). I 
suppose that the config file/s does/do not support %h specifier or something like 
this.


I just want to ask, since I do not want to make the stuff more complicated than 
necessary. So I am all ears if if you know how to simplify/generalize the 
configuration

Thank you,
Dan T,

P.S. systemctl --version

systemd 219
+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP 
+GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD +IDN

on Arch Linux.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150701/96950bff/attachment.sig>


More information about the systemd-devel mailing list