Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] Re: Error handling vs. user friendliness.
Hallo,
> > This will still not avoid the endless reload cycles. It
> might be OK to
> > make one or two tries to reload drivers. But when two
> reloads don't help,
> > two hundered reloads won't help either.
I think that VDR should log an error whenever the Timers or the Channels
are wrong !!!
Maybe it could also stay up for a minute and show a Warning that
Channels.conf is broken.
I once had a Badly broken channels.conf with NO channels at all, but VDR
did not restart!
Therefore I don't like the idea of removing timers that could not be set
to a channel. It would only be OK if VDR does not save that state on
exititing !!
> To be fair, this is something which should then be catered
> for in the 'runvdr'
> script rather than in VDR itself
Here is what I have done, it saved me a couple of times :)
On shutting down VDR, in my "-r" script, I have this :
# Backup Last Known Good Config Files !
cp -f /etc/vdr/setup.conf /etc/vdr/setup.conf.LKG
cp -f /etc/vdr/timers.conf /etc/vdr/timers.conf.LKG
cp -f /etc/vdr/channels.conf /etc/vdr/channels.conf.LKG
This saves a state that should be OK.
(I also do a copy of the last 10 *.conf in my runvdr (outside the while
loop) so that I always can find a working version if "LKG" does not
work.)
And in my runvdr I have the following lines, not very pretty, but works
:), after the start of VDR in the while loop.
I am not sure if this works with timers.conf and setup.conf, but the
channels.conf part definetly works - it "reactivated" VDR a couple of
times in the last 2 years :)
IIRC my wife shut off the Server by removing the Power at least one of
the times ;)
su -p -c "$VDRCMD" $VDRUSR
STATUS=$?
if test $STATUS -eq 0; then exit; fi
# channels.conf OK ?
tail -20 /var/log/messages| grep ERROR |grep channels.conf |grep
line >/dev/null 2>&1
if [ $? -eq 0 ]; then
logger "channels.conf Broken - activating Last Know Good (LKG)
!!"
echo svdrpsend.pl MESG "channels.conf Broken - activating Last
Know Good !! >/dev/null 2>&1"|at now+1 min
cp /etc/vdr/channels.conf.LKG /etc/vdr/channels.conf
fi
# setup.conf OK ?
tail -20 /var/log/messages| grep ERROR |grep setup.conf |grep
line >/dev/null 2>&1
if [ $? -eq 0 ]; then
logger "setup.conf Broken - activating Last Know Good (LKG)
!!"
echo svdrpsend.pl MESG "setup.conf Broken - activating Last
Know Good !! >/dev/null 2>&1"|at now+1 min
cp /etc/vdr/setup.conf.LKG /etc/vdr/setup.conf
fi
# timers.conf OK ?
tail -20 /var/log/messages| grep ERROR |grep timers.conf |grep
line >/dev/null 2>&1
if [ $? -eq 0 ]; then
logger "timers.conf Broken - activating Last Know Good (LKG)
!!"
echo svdrpsend.pl MESG "timers.conf Broken - activating Last
Know Good !! >/dev/null 2>&1"|at now+1 min
cp /etc/vdr/timers.conf.LKG /etc/vdr/timers.conf
fi
You can also use this in commands.conf :
Activate Last Know Good channels.conf? : cp /etc/vdr/channels.conf.LKG
/etc/vdr/channels.conf; printf "\n\nLast Known Good Channels.conf
activated\n\nNow Please Restart VDR !"
Greeting
Christian Jacobsen
Home |
Main Index |
Thread Index