Page MenuHomePhabricator

quarry-web-01 leaks files in /tmp
Open, Needs TriagePublic

Description

zhuyifei1999@quarry-web-01:/tmp$ sudo du -xh .
4.0K	./.X11-unix
4.0K	./.ICE-unix
4.0K	./.XIM-unix
4.0K	./.font-unix
4.0K	./.Test-unix
4.0K	./systemd-private-1356311e7d1243528f7ab2ce78845672-systemd-timesyncd.service-o2aAGy/tmp
8.0K	./systemd-private-1356311e7d1243528f7ab2ce78845672-systemd-timesyncd.service-o2aAGy
4.0K	./pymp-8eb0qg
4.0K	./pymp-FTwMiV
4.0K	./pymp-8qJ9UX
4.0K	./pymp-nn29By
4.0K	./systemd-private-1356311e7d1243528f7ab2ce78845672-lldpd.service-FTKRnQ/tmp
8.0K	./systemd-private-1356311e7d1243528f7ab2ce78845672-lldpd.service-FTKRnQ
4.0K	./pymp-D7yp54
4.0K	./pymp-aMbNX5
16G	.
zhuyifei1999@quarry-web-01:/tmp$ ls -lhSr | tail
-rw------- 1 www-data www-data   27M Jan  1  1980 tmp4ep2kfte
-rw------- 1 www-data www-data   27M Jan  1  1980 tmp33z2r3_y
-rw------- 1 www-data www-data   27M Jan  1  1980 tmp24i0ekrl
-rw------- 1 www-data www-data   27M Jan  1  1980 tmp2269jgn8
-rw------- 1 www-data www-data   27M Jan  1  1980 tmp0l9wsx1_
-rw------- 1 www-data www-data   27M Jan  1  1980 tmp0e20f4bs
-rw------- 1 www-data www-data   27M Jan  1  1980 tmph2ke6104
-rw------- 1 www-data www-data   27M Jan  1  1980 tmp9cf6z32p
-rw------- 1 www-data www-data   30M Jan  1  1980 tmpwm572tjk
-rw------- 1 www-data www-data   90M Jan  1  1980 tmpdpu5pvvb

Event Timeline

Mentioned in SAL (#wikimedia-cloud) [2019-11-14T21:59:43Z] <zhuyifei1999_> zhuyifei1999@quarry-web-01:/tmp$ find /tmp/* -mtime +360 -user www-data -exec sudo rm -v {} \; T238375

They seem to be uncompressed xlsx worksheets.

Per @bd808 tmpreaper tool can be used to delete old files, like what find command did. It is already used somewhere in puppet files (::profile::toolforge::grid::node::web).

The ::tmpreaper module would probably be safe for these instances. Toolforge has to do something slightly more custom, but only because of webservices running on the job grid which leave files in /tmp that should not be removed while the associated service is still running (which can be months at a time).