Bug 1170373

Summary: Accumulation of /var/tmp/systemd-private-* directories
Product: [Fedora] Fedora Reporter: Richard Z. <rz>
Component: systemdAssignee: systemd-maint
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: johannbg, jsynacek, lnykryn, msekleta, s, systemd-maint, udovdh, vpavlin, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-10 09:45:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard Z. 2014-12-03 22:28:31 UTC
On my system systemd appears to create those directories both in /tmp and /var/tmp. Those in /var/tmp are apparently never cleaned up.

# ll -t -d /var/tmp/systemd-private-*|head
drwx------. 3 root root 4096 Dec  3 18:02 /var/tmp/systemd-private-Yig27z
drwx------. 3 root root 4096 Dec  1 00:50 /var/tmp/systemd-private-0xeqNd
drwx------. 3 root root 4096 Dec  1 00:50 /var/tmp/systemd-private-VEgxai
drwx------. 3 root root 4096 Nov 30 11:48 /var/tmp/systemd-private-VGgmLw
drwx------. 3 root root 4096 Nov 19 14:35 /var/tmp/systemd-private-Nlg90r
drwx------. 3 root root 4096 Nov 19 14:35 /var/tmp/systemd-private-ymQz6a
drwx------. 3 root root 4096 Nov 18 11:26 /var/tmp/systemd-private-1b5g8Z
drwx------. 3 root root 4096 Nov  3 22:49 /var/tmp/systemd-private-zwstQf
drwx------. 3 root root 4096 Sep 13 00:34 /var/tmp/systemd-private-NU0tdB
drwx------. 3 root root 4096 Sep 13 00:34 /var/tmp/systemd-private-XR04it

# ll -t -d /tmp/systemd-private-*|head
drwx------. 3 root root 60 Dec  3 18:02 /tmp/systemd-private-eKej6f
(all other were cleaned)

/tmp is normal tmpfs, /var/tmp is on root partition.

I do see "cleaning systmd directories" occasionally but it doesn't touch /var/tmp

I thought that was fixed in #884344 but apparently not quite.

Any clues for debugging welcome.

Comment 1 Lennart Poettering 2015-01-05 02:19:05 UTC
*** Bug 1176323 has been marked as a duplicate of this bug. ***

Comment 2 Fedora End Of Life 2015-01-09 21:33:42 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Fedora End Of Life 2015-05-29 13:27:06 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 udo 2015-05-29 15:00:35 UTC
# ls -l /var/tmp
total 420
drwxr-xr-x   3 abrt abrt 4096 Feb 16 14:24 abrt
drwxr-xr-x. 19 root root 4096 May  3 11:59 ccache
drwx------   2 udo  udo  4096 May 22 17:21 kdecache-udo
drwx------   3 root root 4096 Feb  1 07:36 systemd-colord.service-X4YTtS0
drwx------   3 root root 4096 Mar 13 17:03 systemd-colord.service-XdYFdm2
drwx------   3 root root 4096 Jan 16 04:34 systemd-colord.service-XEUHry2
drwx------   3 root root 4096 Apr 13 17:52 systemd-colord.service-XF5dBQe
drwx------   3 root root 4096 Mar 22 17:20 systemd-colord.service-XFPvLzs
drwx------   3 root root 4096 May 17 15:08 systemd-colord.service-XjY3ymQ
drwx------   3 root root 4096 May  3 09:22 systemd-colord.service-XlqQnUo
drwx------   3 root root 4096 Apr 18 14:31 systemd-colord.service-XmlzWxN
drwx------   3 root root 4096 Mar 21 15:57 systemd-colord.service-XoiSTwI
drwx------   3 root root 4096 Dec  2 14:48 systemd-colord.service-XoWEk4a
drwx------   3 root root 4096 Mar 21 15:32 systemd-colord.service-Xp6uGbd
drwx------   3 root root 4096 Dec  2 15:06 systemd-colord.service-XQkbUzw
drwx------   3 root root 4096 May  2 16:43 systemd-colord.service-XTti5lx
drwx------   3 root root 4096 Mar 14 14:33 systemd-colord.service-XWh4M3K
drwx------   3 root root 4096 Mar  7 10:40 systemd-colord.service-XxcVi5T
drwx------   3 root root 4096 Mar  2 04:30 systemd-colord.service-Xxt74ap
drwx------   3 root root 4096 Dec  2 15:07 systemd-cups.service-X6rO7Et
drwx------   3 root root 4096 Mar 14 14:33 systemd-cups.service-X9fbg8I
drwx------   3 root root 4096 Mar 21 15:59 systemd-cups.service-Xe9IDLL
drwx------   3 root root 4096 Apr 18 14:32 systemd-cups.service-Xep6kyI
drwx------   3 root root 4096 Apr 13 17:52 systemd-cups.service-XETDnvz
drwx------   3 root root 4096 May  2 16:43 systemd-cups.service-XGaTZtq
drwx------   3 root root 4096 May  3 09:22 systemd-cups.service-Xiv13LU
drwx------   3 root root 4096 Dec  2 14:49 systemd-cups.service-XJ6m0B5
drwx------   3 root root 4096 Mar 22 17:20 systemd-cups.service-XMED1vZ
drwx------   3 root root 4096 Mar 21 15:33 systemd-cups.service-XnqZrWS
drwx------   3 root root 4096 Mar 14 12:19 systemd-cups.service-XNyoTis
drwx------   3 root root 4096 Mar  7 10:41 systemd-cups.service-XRrFlWR
drwx------   3 root root 4096 Feb  1 07:37 systemd-cups.service-XsfSW1N
drwx------   3 root root 4096 May 17 15:08 systemd-cups.service-XtimDVZ
drwx------   3 root root 4096 Mar  2 04:31 systemd-cups.service-XVBPgdq
drwx------   3 root root 4096 Jan 16 04:34 systemd-cups.service-XyrqvUr
drwx------   3 root root 4096 Apr 18 14:05 systemd-httpd.service-X0drGqL
drwx------   3 root root 4096 Dec  2 15:06 systemd-httpd.service-X2vC20n
drwx------   3 root root 4096 Jan 16 04:34 systemd-httpd.service-X7CH37K
drwx------   3 root root 4096 Mar 13 17:03 systemd-httpd.service-XCQK5dU
drwx------   3 root root 4096 Mar 22 17:20 systemd-httpd.service-XDJ8fUf
drwx------   3 root root 4096 Apr 18 14:31 systemd-httpd.service-XhPINie
drwx------   3 root root 4096 May  2 16:43 systemd-httpd.service-XhxOaKW
drwx------   3 root root 4096 May 17 15:08 systemd-httpd.service-XJeYmEa
drwx------   3 root root 4096 Mar  7 10:40 systemd-httpd.service-Xjm32cf
drwx------   3 root root 4096 Feb  1 07:36 systemd-httpd.service-XjNWlY3
drwx------   3 root root 4096 Mar  2 04:30 systemd-httpd.service-XKFaE5S
drwx------   3 root root 4096 Mar 21 15:32 systemd-httpd.service-Xkl2cqV
drwx------   3 root root 4096 Dec  2 14:48 systemd-httpd.service-XMTmyDj
drwx------   3 root root 4096 Apr 18 14:12 systemd-httpd.service-XMvRTs0
drwx------   3 root root 4096 Mar 14 14:32 systemd-httpd.service-XNsUwJ7
drwx------   3 root root 4096 Mar 21 15:57 systemd-httpd.service-XTq4fIR
drwx------   3 root root 4096 Apr 13 17:52 systemd-httpd.service-XUdE9dU
drwx------   3 root root 4096 May  3 09:21 systemd-httpd.service-XYQYpV4
drwx------   3 root root 4096 Mar 21 15:32 systemd-mariadb.service-X4H10ip
drwx------   3 root root 4096 May 17 15:08 systemd-mariadb.service-X7YZV26
drwx------   3 root root 4096 May  3 09:21 systemd-mariadb.service-XaTuxXR
drwx------   3 root root 4096 Apr 18 14:12 systemd-mariadb.service-XBnWttK
drwx------   3 root root 4096 Mar 21 15:57 systemd-mariadb.service-XE4krFt
drwx------   3 root root 4096 Dec  2 14:48 systemd-mariadb.service-XEn65UY
drwx------   3 root root 4096 Mar  7 10:40 systemd-mariadb.service-Xf118Ck
drwx------   3 root root 4096 Mar  2 04:30 systemd-mariadb.service-XfQHG9l
drwx------   3 root root 4096 Feb  1 07:36 systemd-mariadb.service-XHCgFmf
drwx------   3 root root 4096 Dec  2 15:06 systemd-mariadb.service-XI8bS1b
drwx------   3 root root 4096 Apr 13 17:52 systemd-mariadb.service-XInCacA
drwx------   3 root root 4096 Apr 29 15:39 systemd-mariadb.service-XJ7cmrh
drwx------   3 root root 4096 May  2 16:43 systemd-mariadb.service-XKnP6h4
drwx------   3 root root 4096 Mar 14 14:32 systemd-mariadb.service-XP3ehOW
drwx------   3 root root 4096 Apr 18 14:05 systemd-mariadb.service-Xqnlmtj
drwx------   3 root root 4096 Jan 16 04:34 systemd-mariadb.service-XVFEDb6
drwx------   3 root root 4096 Mar 22 17:20 systemd-mariadb.service-XxVcDAA
drwx------   3 root root 4096 Mar 13 17:03 systemd-mariadb.service-XyUIkj1
drwx------   3 root root 4096 Dec  2 14:48 systemd-ntpd.service-X4gDLdY
drwx------   3 root root 4096 Dec  2 15:06 systemd-ntpd.service-Xa33j5v
drwx------   3 root root 4096 May 17 15:08 systemd-ntpd.service-XafAtFq
drwx------   3 root root 4096 Mar 21 15:57 systemd-ntpd.service-XcSys2x
drwx------   3 root root 4096 Apr 18 14:05 systemd-ntpd.service-XcxAicg
drwx------   3 root root 4096 Mar 13 17:03 systemd-ntpd.service-XDuhsSH
drwx------   3 root root 4096 Mar 22 17:20 systemd-ntpd.service-Xireyhu
drwx------   3 root root 4096 Apr 18 14:12 systemd-ntpd.service-XJnt9WT
drwx------   3 root root 4096 Apr 23 08:59 systemd-ntpd.service-XK2hikp
drwx------   3 root root 4096 Mar 14 14:33 systemd-ntpd.service-XnJUCjh
drwx------   3 root root 4096 Mar  2 04:30 systemd-ntpd.service-XnNd27h
drwx------   3 root root 4096 Apr 13 17:52 systemd-ntpd.service-Xozi2iN
drwx------   3 root root 4096 May  2 16:43 systemd-ntpd.service-XpgOYJC
drwx------   3 root root 4096 Mar  7 10:40 systemd-ntpd.service-Xtav31h
drwx------   3 root root 4096 Feb  1 07:36 systemd-ntpd.service-XU0z6PG
drwx------   3 root root 4096 Mar 21 15:32 systemd-ntpd.service-XvX2bOk
drwx------   3 root root 4096 May  3 09:22 systemd-ntpd.service-XXfECbc
drwx------   3 root root 4096 Jan 16 04:34 systemd-ntpd.service-XxjNSf0
drwx------   3 root root 4096 Apr 18 14:31 systemd-rtkit-daemon.service-X3hIoTZ
drwx------   3 root root 4096 Mar 21 15:57 systemd-rtkit-daemon.service-X6d58AW
drwx------   3 root root 4096 May 17 15:08 systemd-rtkit-daemon.service-XaVwFD0
drwx------   3 root root 4096 Mar 22 17:20 systemd-rtkit-daemon.service-Xd81VSs
drwx------   3 root root 4096 Mar 14 14:33 systemd-rtkit-daemon.service-Xh2HbTg
drwx------   3 root root 4096 Dec  2 15:06 systemd-rtkit-daemon.service-XizrslT
drwx------   3 root root 4096 Mar 13 17:03 systemd-rtkit-daemon.service-XjDoTCo
drwx------   3 root root 4096 Apr 13 17:52 systemd-rtkit-daemon.service-Xnwb5JJ
drwx------   3 root root 4096 Dec  2 14:48 systemd-rtkit-daemon.service-XpGBK5o
drwx------   3 root root 4096 Jan 16 04:34 systemd-rtkit-daemon.service-XPJWSX0
drwx------   3 root root 4096 Mar  2 04:30 systemd-rtkit-daemon.service-XpwRQ9y
drwx------   3 root root 4096 May  2 16:43 systemd-rtkit-daemon.service-XrJqTuu
drwx------   3 root root 4096 Mar  7 10:40 systemd-rtkit-daemon.service-XRKjWCv
drwx------   3 root root 4096 Mar 21 15:32 systemd-rtkit-daemon.service-Xv9PPW9
drwx------   3 root root 4096 Feb  1 07:36 systemd-rtkit-daemon.service-XvUgqeO
drwx------   3 root root 4096 May  3 09:22 systemd-rtkit-daemon.service-XXM2DTE

Comment 5 Fedora End Of Life 2015-11-04 11:41:20 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Jan Synacek 2015-11-10 09:45:56 UTC
I don't see this problem on F23 anymore.

Comment 7 udo 2015-11-13 12:10:21 UTC
Did we test the scenario's under which directories in said locations are created and/or removed?
What is the expected behaviour aside from `not too many directories`?

Comment 8 udo 2015-11-13 12:11:34 UTC
BTW: I see the same thing as in https://bugzilla.redhat.com/show_bug.cgi?id=1183684

Comment 9 Zbigniew Jędrzejewski-Szmek 2015-11-13 13:56:19 UTC
This is supposed to work like this:

systemd creates /var/tmp/systemd-private-<boot-id>-<unit-name>-<random>/ and /tmp/systemd-private-<boot-id>-<unit-name>-<random>/ when starting the service. When stopping the service, those directories are removed.

If the machine crashes, /tmp/systemd-private* directories are gone on reboot because /tmp is volatile. /var/tmp/systemd-private* directories are left around, and will be cleaned up using normal /var/tmp time-based cleanup.

Please note that you cannot *look* inside the directories in /var/tmp/systemd-private* at all, because each time you do, the access time is bumped, and the cleanup is postponed. It is only possible for privileged processes to avoid bumping the atime and systemd-tmpfiles does that. Also you need to disable the gnome /tmp cleanup, because it runs as unprivileged user and bumps the atimes.

Comment 10 udo 2015-11-15 15:35:43 UTC
Thanks. noatime mount option should fix the *look* issue.
How can I simply test the bugfix?

Comment 11 Zbigniew Jędrzejewski-Szmek 2015-11-15 16:22:22 UTC
(In reply to udo from comment #10)
> How can I simply test the bugfix?
Just use the latest systemd packages, there were no recent changes in this area.