Clearing log file doesn't work (many methods attempted)

From: Ian Wallace (iwallace@eforceglobal.com)
Date: Tue Nov 19 2002 - 17:48:35 EST


I tried to search the archives and found some stuff related but didn't
seem to fix the issue so I thought I would ask. If this has been
answered before please just a quick link to the answer and I will be
very grateful. Thanks!

I'm working on a number of Sun servers which run an application server
(Broadvision). It uses CORBA as it's underlying framework and all the
servers write to a log file 'orbixd.log' (they use IONA for the ORB).
After a while this log file grows quite large and we want to rotate it
so that we can keep space usage down. I have tried the following:

1) Making a copy of the log file to a different name (with a timestamp)
and then cat /dev/null > orbixd.log or cp /dev/null > orbixd.log or some
incantations of sed in the form of sed '1,<last line>d' orbixd.log >
orbixd.log (I realize that's a little crazy since it's going to blow
away the file once it's opened but it was suggested by tech support).

The file will go to zero bytes for all of a couple seconds and then pop
back to 550+MB (as displayed with ls -la).

The size returned from du -sk is about the correct size (very small).

When I cat the file I notice after doing one of the methods that the
file is empty, and has *lots* of empty space at the beginning of it (but
then wc -l reports something like 2000 lines, for a 550+MB file).

We have not removed the file (the servers aren't writing to an inode
that I can't see which is the usual variant on this question). I just
can't clear the file out.

Note: This is a file system mounted on an EMC array. And this is a
special 'image' that has been developed for this company (certain items
have been removed such as all the man pages, etc).

cheers
ian

-- 
Ian Wallace - iwallace@eforceglobal.com
303.218.2040 (w) 720.308.5696 (m) 303.218.2100 (f)
eForce Managed Services, Denver CO 
Enterprise IT Solutions. Fixed Price. Fixed Time.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:19 EDT