3

Program is running in parallel on multiple processors and is writing logs to a central host via NFS under RH7.3 or SUSE 11.3. If program crashes or hangs then tails of log files are lost and we lack information on the location and reason of the crash.

Shell sync has no effect. Mounting mode is async for a strong reason: in case of sync mode the times of loading initial data and unloading results increase by the factor of 10, from minutes to hours. Sometimes flush() inserted in the program may help but it is difficult to do when the location is not known for certain.

So, is it possible to force an NFS client to flush its buffers unconditionally when the process terminates, no matter how?

Anthon
  • 79,293
vladimir
  • 31
  • 1

1 Answers1

2

Once the output gets into the actual NFS client's buffer, it should make it to the server - I'm afraid you are losing the data in the usual stream buffers. Try modifying the buffering properties with setvbuf().

You probably also want to enable coredumps for the crashing application so that you have something to debug - see How to enable core dump in my Linux C++ program and prctl(PR_SET_DUMPABLE, ...)

peterph
  • 30,838