2 points · by Garbage · 15y ago · 4 comments
But if all the files really ARE still open, I have a question about lsof.
Couldn't you use lsof to create a hard link to the file again and save it that way, instead of copying to a new file? It was my understand that the file is only gone once all hard links are gone.
anthony@Zia:/proc/28590/fd$ ln 4 /tmp/bar
ln: creating hard link `/tmp/bar' => `4': Invalid cross-device link
Linux's link(2) call takes path names, not file descriptors, so even a ptrace inject into the still-running app won't help.I don't believe its (currently) possible to re-link the file, without direct filesystem editing.
I think I'll add it to my list in case nobody else does it.