2015 shaares
45 private links
45 private links
pour tronquer un fichier verrouillé par un processus.
myserver1# cd /proc/25139/fd
myserver1:/proc/25139/fd# ls -l 4
lr-x------ 1 root root 64 2010-01-07 17:10 4 -> /var/log/myapp/userlog (deleted)
We can do almost everything with this file (called 4 here) what we can do with a real file: we can less it, copy it, and we can change its contents!
Free up the Space
As already said, we cannot remove the file, but what we can do is getting the size down to zero. And that's done as with every other file, e.g. if you use bash (or ksh) - what is most likely under Linux:
myserver1# > /proc/25139/fd/4