Hello all.
I have a rather strange issue I'm attempting to fix here. One of the servers I work with had a log file reach 2GB in size and stopped logging. The software which is logging to said file cannot be stopped or restarted and does not provide a way to rotate log files -- poor design, I know. So in my infinite wisdom (or stupidity, however you want to read that), I truncated the log file in place with:
When I realized the log file was not being appended to, I checked lsof output and it shows the following:
Code:
vmsproxy 11541 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
vmsproxy 12779 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
vmsproxy 12782 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
vmsproxy 12783 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
vmsproxy 12784 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
vmsproxy 12785 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
vmsproxy 12786 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
vmsproxy 12787 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
vmsproxy 12788 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
vmsproxy 12790 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
vmsproxy 12791 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
vmsproxy 12793 root 2w REG 9,6 0 295029 /var/log/vmsproxy.log (deleted)
So I tried to recover the file by running:
Code:
cp /proc/11541/fd/2 /var/log/vmsproxy.log
The problem I have now is this:
Code:
# cat vmsproxy.log
cat: vmsproxy.log: No such file or directory
# file vmsproxy.log
vmsproxy.log: can't stat `vmsproxy.log' (No such file or directory).
# ls -i vmsproxy.log
ls: vmsproxy.log: No such file or directory
# touch vmsproxy.log
touch: creating `vmsproxy.log': File exists
# rm -f vmsproxy.log
# touch vmsproxy.log
touch: creating `vmsproxy.log': File exists
# lsattr vmsproxy.log
lsattr: No such file or directory while trying to stat vmsproxy.log
The file exists and yet it doesn't. Meanwhile, I have no logfile to perform troubleshooting with. My question is this:
Does anybody know how I can make this file either go away or come back? I'll be more than happy to provide command output.