<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 16/11/12 10:41 AM, Thomas Mashos wrote:<br>
<blockquote
cite="mid:CAMtSsR3X9X4CoR+_KT2pDy5naVYN1n+Ygrp3k0wHba_d93VvEw@mail.gmail.com"
type="cite">That doesn't make sense, there is nothing that would
have the NetworkManager depend on the backend to start (the
networking start scripts are what is used in regular Ubuntu
without any MythTV). What happens if you remove the script you
added to check the network and then just stuck a '<span
style="background-color:rgb(249,249,249);color:rgb(0,0,0);line-height:1.1em">sleep
300' (5 minutes) in the backend upstart script right before the
backend starts?</span>
<div class="gmail_extra"><br clear="all">
Thanks,<br>
<br>
Thomas Mashos<br>
</div>
</blockquote>
Adding a 300s delay in the 'mythtv-backend' script just makes the
boot take 5 minutes longer -- including the start of the
'network-manager' :(<br>
<br>
However, through some deep digging, I have found a solution -- and I
am very curious whether (at least part of) this could be applied to
future packaging of MythTV to avoid problems for others...<br>
<br>
In my case, there were two parts to the solution:<br>
<br>
1) An understanding that Linux Debian has moved to a 'dependency
based boot sequence' methology:<br>
<br>
<a class="moz-txt-link-freetext" href="http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot">http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot</a><br>
<a class="moz-txt-link-freetext" href="http://wiki.debian.org/LSBInitScripts">http://wiki.debian.org/LSBInitScripts</a><br>
<br>
Previously, it used an older (SysV?) approach where the scripts in
the various runlevel 'rcN.d' directories were run in alphabetic
order. In this older system, I also would have had problems, since
'S21m' occurs before 'S21n':<br>
<br>
darren@frodo2 /etc/rc2.d $ ls -1<br>
...<br>
S21mythtv-backend<br>
S21network-manager<br>
...<br>
<br>
OK, so I checked what the newer 'LSB' fields were in the
'mythtv-backend' script:<br>
<br>
### BEGIN INIT INFO<br>
# Provides: mythtv-backend<br>
# Required-Start: $local_fs $remote_fs <br>
# Required-Stop: $local_fs $remote_fs <br>
# Should-Start: mysql<br>
# Should-Stop: mysql<br>
# Default-Start: 2 3 4 5<br>
# Default-Stop: 0 1 6<br>
# Short-Description: Start/Stop the MythTV server.<br>
### END INIT INFO<br>
<br>
I changed it slightly so that 'network-manager' is a 'required'
prerequisite:<br>
<br>
### BEGIN INIT INFO<br>
# Provides: mythtv-backend<br>
# Required-Start: $local_fs $remote_fs network-manager<br>
# Required-Stop: $local_fs $remote_fs network-manager<br>
# Should-Start: mysql<br>
# Should-Stop: mysql<br>
# Default-Start: 2 3 4 5<br>
# Default-Stop: 0 1 6<br>
# Short-Description: Start/Stop the MythTV server.<br>
### END INIT INFO<br>
<br>
I then ran the following command (I think it is required after
making script changes like that):<br>
<br>
darren@frodo2 /etc/init.d $ sudo update-rc.d mythtv-backend defaults<br>
<br>
This appears to have changed the naming of the script in
'/etc/rc2.d' so that it is alphabetically *after* the network start:<br>
<br>
darren@frodo2 /etc/rc2.d $ ls -1<br>
...<br>
S21network-manager<br>
...<br>
S22mythtv-backend<br>
...<br>
<br>
A reboot confirms the new order:<br>
<br>
darren@frodo1 /etc/rc2.d $ sudo sed $'s/\^\[/\E/g;s/\[1G\[/\[27G\[/'
/var/log/boo<br>
...<br>
Fri Nov 16 12:57:01 2012: [ ok ] Starting MySQL database server:
mysqld . ..<br>
Fri Nov 16 12:57:05 2012: [info] Checking for tables which need an
upgrade, are corrupt or were <br>
Fri Nov 16 12:57:05 2012: not closed cleanly..<br>
Fri Nov 16 12:57:05 2012: [ ok ] Starting network connection
manager: NetworkManager.<br>
Fri Nov 16 12:57:06 2012: [ ok ] Starting MDM Display Manager: mdm.<br>
Fri Nov 16 12:57:16 2012: Starting MythTV server: mythbackend .<br>
...<br>
<br>
I found out from experimention that merely manually renaming the
scripts in '/etc/rc2.d' wasn't good enough -- those 'LSB' fields are
required.<br>
<br>
Not sure what the (say) Ubuntu scripts order system is, so I think
that what I said above doesn't apply to those folks.<br>
<br>
2) Though I was very optimistic that the above would solve all my
problems, it did not. Apparently, waiting for 'network-manager' to
start isn't quite good enough. So I added my home-made script back
into 'mythtv-backend':<br>
<br>
#! /bin/sh<br>
/usr/local/bin/wait4net.sh 60 > /tmp/wait4net.out 2>
/tmp/wait4net.err<br>
...<br>
<br>
After rebooting again, I saw the fruits of my labors i.e. it took
about another 5s for the wireless IP address to be established:<br>
<br>
darren@frodo1 /etc/init.d $ cat /tmp/wait4net.out<br>
Fri Nov 16 12:57:12 CST 2012 not yet! attempt: 1<br>
Fri Nov 16 12:57:13 CST 2012 not yet! attempt: 2<br>
Fri Nov 16 12:57:14 CST 2012 not yet! attempt: 3<br>
Fri Nov 16 12:57:15 CST 2012 not yet! attempt: 4<br>
Fri Nov 16 12:57:16 CST 2012 not yet! attempt: 5<br>
Fri Nov 16 12:57:16 CST 2012 success! after attempt: 6<br>
...<br>
wlan1 Link encap:Ethernet HWaddr 00:14:d1:36:cf:c8 <br>
inet addr:192.168.1.101 Bcast:192.168.1.255
Mask:255.255.255.0<br>
inet6 addr: fe80::214:d1ff:fe36:cfc8/64 Scope:Link<br>
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br>
RX packets:3 errors:0 dropped:0 overruns:0 frame:0<br>
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0<br>
collisions:0 txqueuelen:1000 <br>
RX bytes:670 (670.0 B) TX bytes:1114 (1.0 KiB)<br>
<br>
On my remote frontend, 'mythfrontend' started up fine with no more
connection errors!<br>
<br>
Comments anyone? Does part #1 of my solution make sense for Debian
folks running MythTV?<br>
<br>
Thanks<br>
<br>
</body>
</html>