I have a process running very long time.
I accidentally deleted the binary executable file of the process.
Since the process is still running and doesn't get affected, there must be the original binary file in somewhere else….
How can I get recover it? (I use CentOS 7, the running process is written in C++)
Best Answer
It could only be in memory and not recoverable, in which case you'd have to try to recover it from the filesystem using one of those filesystem recovery tools (or from memory, maybe). However!
With interpreted programs, obtaining the script file may be somewhere between tricky and impossible, as
/proc/$$/exe
will point toperl
or whatever, and the input file may already have been closed:Only the standard file descriptors are open, so
x
is already gone (though may for some time still exist on the filesystem, and who knows what the interpreter has in memory).