irritating arugs behaviour

Carter Bullard carter at qosient.com
Wed Oct 3 22:12:46 EDT 2007


Hey Russell,
So we have mechanisms in argus to periodically check the filesystem.
We're running stat() against the output file only once every second to
see if the file has been renamed and there is a need to recreate it.
We can use the same mechanism to do a statfs() to see if there is
any space to write out to the disk.

So question is, should we have thresholds for the amount of free space
that needs to be there to write out, and free space to start writing
again after stopping?  Seems reasonable.  The system call statfs()
can differentiate free blocks available to non-super user and total
free blocks, so ..... seems that argus is running as root, so we'll
worry about total free blocks?

So how does this sound? When we reach the limit, or fail due to
a number of reasons, we close the output file.  Then every second
when we have records to write out, we'll test the filesystem for
space, and as soon as space becomes free, we'll reopen the file,
or recreate it, and start writing again.

We probably need to tally the number of records that weren't
written, so I'll have to figure out how to do that, possibly writing
the number in the initial MAR that is written to the new file.

Is that what you were thinking?

Carter

Russell Fulton wrote:
>> I was very glad to see that the program "arugs" was irritating you
>> instead of my program.
>>     
> :-P
>
> R
>
> Yes, I agree that deciding what the best way to handle this is not
> obvious and you certainly don't want to keep trying to write every
> record as you will almost certainly end up with corrupt files.
>
> Cheers, Russell
>
>
>   





More information about the argus mailing list