[PLUG] flushing buffers?
Denis Heidtmann
denis.heidtmann at gmail.com
Thu Jan 6 18:21:29 UTC 2011
On Thu, Jan 6, 2011 at 10:00 AM, Larry Brigman <larry.brigman at gmail.com>wrote:
> On Thu, Jan 6, 2011 at 9:56 AM, Denis Heidtmann
> <denis.heidtmann at gmail.com> wrote:
> > I am writing a little script to record the battery voltage v.s. time. I
> > want to run it until the system shuts down due to low voltage. Is it
> > reasonable to expect that the system will write the file buffer to the
> disk
> > prior to shutdown? If not, what is a reasonable way to handle the
> problem?
> > The system is ubuntu 10.04, the hardware is an ASU eee pc 900.
>
> If the system does it's own monitoring to do the shutdown then you
> will need a signal
> handler to catch the shutdown and/or term signal to go record record a
> reading and flush your buffers.
>
The system does the shutdown. You are saying that the system will NOT
bother with dirty buffers; that if the system shuts down due to running out
of battery power any applications running are on their own.
This may explain a failure I had with this machine shortly after I received
it: I ran it 'till it shut down. When it came back up the some parts of X
were hosed. There are other explanations for the failure, but this may top
the list if in fact the system behaves as you say.
I will have a bash loop running. All I would need to do is force a write to
the disk in the loop as it nears the shutdown voltage. How do I force a
write?
Thanks,
-Denis
More information about the PLUG
mailing list