<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 4, 2017 at 10:44 PM, Bill Meek <span dir="ltr"><<a href="mailto:keemllib@gmail.com" target="_blank">keemllib@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 10/04/2017 08:08 PM, Hika van den Hoven wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hoi Ian,<br>
<br>
Wednesday, October 4, 2017, 11:53:06 PM, you wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Sorry for all the recent posts, but after running MythTV since<br>
2011, the upgrade to 29/16.04 has tossed a few curveballs at me.<br>
Most things have been smooth but there's a few small issues, perhaps<br>
due to the fact that the previous Mythbuntu ISO install handled so many tasks for you.<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
In order to start the mythfrontend on my combined FE/BE at boot I<br>
added the mythfrontend command to Sessions and Starup. But it's hit<br>
and miss as to whether it starts up before the backend/mysql are<br>
fully up. If it starts before then, even the subsequent retries seem<br>
to be failing the dbawake test, even though mythbackend is running and connected to mysql.<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Looking at<br>
<a href="https://www.mythtv.org/wiki/Configuring_Frontend#Starting_the_Frontend" rel="noreferrer" target="_blank">https://www.mythtv.org/wiki/Co<wbr>nfiguring_Frontend#Starting_th<wbr>e_Frontend</a>,<br>
I don't see any mention of scripting the startup.<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Should the Frontend be started with systemd instead and if so is<br>
there a recommended service file that waits for the backend and<br>
mysql to be fully functioning before starting mythfrontend?<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks.<br>
</blockquote>
<br>
If you want to be sure the backend is up add a sleep command to your<br>
frontend startup script. Like sleep 5 to wait 5 seconds, which should<br>
be more then enough.<br>
</blockquote>
<br></span>
To be sure the backend is up and running (not still starting up)<br>
consider the following, probably without the echos:<br>
<br>
ATTEMPTS=20<br>
BACKEND='yourBackendHostNameOr<wbr>IP'<br>
<br>
for TRIES in $(seq $ATTEMPTS); do<br>
    curl --silent --max-time 1 $BACKEND:6544/Myth/GetHostName > /dev/null<br>
    if [ $? = 0 ]; then<br>
        echo "$BACKEND is up"<br>
        break<br>
    fi<br>
    echo "Waiting for $BACKEND..."<br>
done<span class="gmail-HOEnZb"><font color="#888888"><br>
<br></font></span></blockquote><div><br></div><div>Added my info and put this in a bash script, mythfrontendstart.sh. Added /home/ian/mythfrontendstart.sh to Ubuntu's Sessions and Startup list. Rebooted. Nada. Zip.</div><div><br></div><div>Ran /home/ian/mythfrontendstart.sh from the terminal and it started fine.</div><div><br></div><div>Looked at journalctl -b0 but couldn't seem to find any mention of it trying to call /home/ian/mythfrontendstart.sh. Of course I could be looking in the wrong log.</div></div></div></div>