11

I am running some programs on both Debian and Fedora. When I ls the /tmp directory, I see many directories with extremely long name like

systemd-private-d85027...-bluetooth.service-qxzMGm
systemd-private-d85027...-chronyd.service-vSzXdP
systemd-private-d85027...-colord.service-LvpIL2
systemd-private-d85027...-fwupd.service-cbpodH
systemd-private-d85027...-httpd.service-rJIaIX

It seems to be related to PrivateTmp, but how can I remove them or move them to a less distracting location? (e.g. from /tmp/systemd-... to /tmp/.systemd-...) I want to try not to change the PrivateTmp option for every service.

2
  • 4
    I don't think there's a good way to do that... There's reasons for that to be under /tmp or /var/tmp (e.g. preserving the SELinux context)... The names are currently hardcoded in systemd, not sure they're going to change... I guess my advice here is to avoid using /tmp for things you want to find later using ls? Not sure what's your particular use case (or if you can avoid /tmp), anyways, leaving a comment in hopes it might be helpful...
    – filbranden
    Apr 3, 2018 at 22:07
  • As filbranden says, you should probably avoid using /tmp for your files. Check to see if $TMPDIR or $TMP are set (or set them yourself) and use one of them. I generally use $TMPDIR if defined, then $TMP if defined, then fall back to /tmp
    – MERM
    Mar 16 at 5:15

0

You must log in to answer this question.

Browse other questions tagged .