/tmp full

good morning

The /tmp filesystem is full at 99 %
I have do a "rm" but the size is the same.
so i think that a process is always alive, but how can i do to know it ? (because I have deleted some file in /tmp)

thank you

use "fuser" (man fuser) to find out which process is using which file.

Alternatively get you the freeware tool "lsof" which is doing about the same.

bakunin

thank you for your response
My problem is that i have deleted some files in /tmp, so perhaps the "busy" file.

In this case reboot the machine to shut down the process and see if the filesystem is empty now. If this is the case your problem is solved - implement some watchdog script to prevent hogging of /tmp-space again.

bakunin

thank you !

i can't reboot now, it is a production server......
:frowning:

could it be that your /tmp filesystem is large and the files that you deleted are small in comparison?

maybe try and use the 'du' command to see how large subdirectories are too.

of course, that's not to say that you deleted a large with a process still attached to it as others have mentioned also.

hello

yes i have verifies before with a "du" if a directory is full in /tmp, but not, just small directory.
I try to work for the script to detect what process use what file, but not easy.. !

no... you're right. a script like that will not be very straight-forward.

what you may wanna do is possibly write a script that will check /tmp filesystem's utilization rather than try and hunt down what process writes what.

after catching a few "large" files being created, you'll have a good idea as to what USUALLY causes the problem.

applications will USUALLY tell you (in documentation) if you need a certain amount of space in /tmp. shoddily programmed ones won't clean them up. :slight_smile:

When you use the "rm" command in unix, you unlink a file from a directory. If that was the last link and if the file was not open, the space will be freed. The second condition always catches people. A program opens a large file in /tmp. Someone comes along and "removes" it. Then they wonder why the space was not freed.