[mythtv-users] Auto-started Mythbackend = Remote Mythfrontend connection failure
Darethehair
darethehair at gmail.com
Fri Nov 16 14:18:58 UTC 2012
[Can I respond to the thread that I started this way, without starting a
fresh thread? I guess I will find out. Didn't the old 'nabble' system
allow one to read and post from a web page?]
Thanks for the comments so far, folks, but it is looking tricky. I
whipped up my own version of a quick-and-dirty 'wait for network' script
that looks like this:
wait4net.sh
----------------
#!/bin/bash
/sbin/ifconfig | grep "192.168" > /dev/null 2> /dev/null
status=$?
counter=1
max=$1
while [ $status != 0 ]; do
sleep 1
/sbin/ifconfig | grep "192.168" > /dev/null 2> /dev/null
status=$?
echo $(date) "not yet!" "attempt: $counter"
if [ $counter -ge $max ]; then
echo "giving up after $counter attempts!"
exit
fi
counter=$((counter+1))
done
echo $(date) "success!" "after attempt: $counter"
/sbin/ifconfig
Then, as the first executable line in '/etc/init.d/mythtv-backend', I
added a call to that script:
/usr/local/bin/wait4net.sh 120 > /tmp/wait4net.out 2> /tmp/wait4net.err
After a few attempts, I have confirmed that my script 'gives up waiting'
for a valid '192.168.x.x' entry to show up in 'ifconfig' output -- even
after 2 minutes. Yes, it is a wireless connection that I am running my
mythbackend on, but this is plenty generous in time given.
Either I am misunderstanding something, *or* what is actually happening
is that my (wireless) network is waiting till *after* the
'mythtv-backend' scripts runs/completes to execute -- in which case it
would be pointless for me to wait in this way. Does anyone know offhand
what order stuff happens in during bootup?
Thanks
More information about the mythtv-users
mailing list