Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: 18 Minutes - what does that tell?




Klaus Schmiedinger wrote:

[lines removed]

>> However the script could open an SVDRP connection and
>> issue a 'NEXT rel' to obtain the next timer event.
>> If the value returned is less than
>> zero a recording is currently in progress.
>> In this case noflushd shouldn't be started.
>> What do you think? Would be simple but effective change.

> I'm afraid this won't work, since there are no SVDRP commands handled
> while the "recording" script is active.

Ouch, just as you say it I remember (I think) INSTALL saying that
it is blocking -- sorry.

> But you could handle a counter (stored in a file) yourself which is
> incremented with every call "before", and decremented with every
> call "after". If the counter becomes '1' after incrementing, you call
> "/etc/init.d/noflushd stop", if it becomes '0' after decrementing you
> call "/etc/init.d/noflushd start". It is guaranteed that only _one_
> call to the "recording" script is made at a time.

OK, this could be one way to go. But i don't consider it being very
reliable in case of crashes or other unforseen things to happen...
Imagine the VDR to crash before a timer ends and comes up
just after a timer would end, the stop will never be heard by
the script resulting in an invalid count.
OK, this might be very constructed and rare but as you know
what can go wrong will go wrong.
Thus I think receiving the information directly from VDR is
the most reliable thing to do.
"Before" is OK to call '/etc/init.d/noflushd stop' everytime
because it doesn't hurt if noflushd is already stopped - the
disk will spin up in any case.
"After" should call a "start_noflushd" script in the background
and return immediatly.
"start_noflushd" could first sleep some time (1-5 seconds) then
connect via SVDRP and receive the information.
If no recordings are underway or additionally not in near
future (say d = +1 minute) noflushd can be started.
This would prevent the race condition between "before"
trying to stop noflushd and "start_noflushd" to start noflushd
(in case a recording ends just before another is about to start).
Execution time (including sleep) of "start_noflushd"
should be << d.
If d is great enough it is sure that "before" won't be called
while "start_noflushd" is running.
"start_noflushd" could be implemented by modifying the
/etc/init.d/noflushd script for the "start" parameter in the
described way.
"after" could call '/etc/init.d/noflushd start &'.

Regards
  Richard




Home | Main Index | Thread Index