LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-11-2011, 03:57 PM   #1
dreaken667
LQ Newbie
 
Registered: Jul 2011
Posts: 4

Rep: Reputation: Disabled
File exists and yet it doesn't


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:

Code:
>vmsproxy.log
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.
 
Old 07-11-2011, 04:16 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Run a filesytem check on the drive(s)
 
Old 07-11-2011, 04:17 PM   #3
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi there,

Type the output of ls -al /var/log

What does
Quote:
rm -r -f /var/log/vmsproxy.log
yeilds?
 
Old 07-11-2011, 04:19 PM   #4
dreaken667
LQ Newbie
 
Registered: Jul 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
I was afraid you were going to say that. I cannot take the system down to run fsck for the same reason I could not restart the service creating the log file. It's a production system that is under heavy load 24/7.


EDIT:

rm -rf /var/log/vmsproxy.log yeilds no output
ls -al /var/log prints the contents of the directory, but vmsproxy.log is not in the list

Last edited by dreaken667; 07-11-2011 at 04:21 PM.
 
Old 07-11-2011, 04:23 PM   #5
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
If this is a heavy-use, business critical, 24/7 system, why do you not have a second system you can failover to?
 
Old 07-11-2011, 04:28 PM   #6
dreaken667
LQ Newbie
 
Registered: Jul 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
I didn't design the system or the network. I've taken the position of someone that used to work here.
A backup system has been proposed to the higher ups, but there is not one at the moment.
 
Old 07-11-2011, 04:47 PM   #7
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
I guess you just got some ammunition for that fight, then.

It looks to me like user vmsproxy had the file open when it was deleted, and it still has it open even though it's gone. The easiest way to resolve that would be to shut down the application, and you might even see those (deleted) issues disappear right away. If not, you should at least be able to remove them with the app down, restart, and all is kosher. If this works out, we're talking about a 5 minute outage.

And if it doesn't... then however long it takes to perform an fsck and act on the results.
 
Old 07-11-2011, 06:00 PM   #8
dreaken667
LQ Newbie
 
Registered: Jul 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
I had the ammunition to begin with, but this is definitely icing on the cake.
That confirms my suspicions then. Thank you all for the time.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rkhunter.conf doesn't exists? qwertyjjj Linux - Newbie 19 02-17-2011 10:57 AM
ls -a doesn't show the file that exists pratapmaddi Linux - Newbie 3 09-10-2009 09:31 AM
need to restart apache if file doesn't exists SupermanInNY Programming 1 06-06-2009 12:44 PM
File that doesn't want itself to be removed (if it even exists?) b0uncer Other *NIX 3 10-24-2007 02:42 PM
SIOCADDRT: File exists SIOCCADDRT: File Exists Failed to bring up eth0. opsraja Linux - Networking 0 01-10-2005 08:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration