Systemd tmpfiles configuration

hi all,

(running 2.0 on el8)

we are facing now and then issues with user sessions that always lead back to subdirectories under /var/tmp/ondemand-nginx/xyz being removed (client_body disappearing is a “popular” one).

i only now realised this is most likely systemd-tmpfiles cleaning up things, and i was wondering what the recommendations are for this, in particular, tmpfiles completely ignore /var/tmp/ondemand-nginx

(it would be good if ood itself managed this by either settign this systemwide eg in /usr/lib/tmpfiles.d/ood.conf, or adding a per user exclude in eg /run/tmpfiles.d/ood-userxyz.conf each time the pun is started)


Could you test a change for us to see if we can override the defaults for “/var/tmp”? Something like this:

cat > /etc/tmpfiles.d/ondemand-nginx-tmp.conf <<EOF
d /var/tmp/ondemand-nginx 0755 root root - -
Z /var/tmp/ondemand-nginx -    -    -    - -

If that kind of change resolves the issue then we can incorporate it into the OnDemand distributed tmpfiles.d files that would come with the RPM or Deb packages.

why the Z ? i’m testing with x now

The Z line ensures SELinux contexts are applied upon creation. If you don’t use SELinux you don’t need it but when we ship the change in RPMs we have to include that line as it’s required for sites using SELinux and harmless to sites not using SELinux.

but then i don’t understand what the purpose is of your proposed config. it’s won’t prevent the removal of some of the user dirs

The goal is to define a path under /var/tmp that do not set the age value in hopes that will override the expiration set for /var/tmp.

ok, i understand

from the man page
“The age field only applies to lines starting with d, D, e, v, q, Q, C, x and X. If omitted or set to “-”, no automatic clean-up is done.”

so no trailing ‘-’ needed (also not for Z)

i’ll test this instead of the x, it’s a much better way than using ‘x’. i am assuming the /var/tmp/ondemand-nginx is configurable, but it doesn’t hurt to set this even unused (and admins using other location should take care/know better :wink:

/var/tmp has 30d in our (default?) el8 setup.
i’ll try to construct something quicker to test your proposal

@tdockendorf apologies for not following through, but this works and imho should be the default