Mailing List archive

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

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



Richard Cieply wrote:
> 
> ...
> 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 &'.

Why don't you just set up a CRON job that regularly connects to the
SVDRP port and checks if there is currently a timer active (or will be in the
near future), and if not, call "/etc/init.d/noflushd start".
In the "record" script you could call "/etc/init.d/noflushd stop".
So the first recording that starts would stop the noflushd, and the CRON
job would finally start it again.

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________



Home | Main Index | Thread Index