<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 5, 2017 at 10:37 PM, Stephen Worthington <span dir="ltr"><<a href="mailto:stephen_agent@jsw.gen.nz" target="_blank">stephen_agent@jsw.gen.nz</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"><div class="gmail-HOEnZb"><div class="gmail-h5">On Wed, 4 Oct 2017 17:53:06 -0400, you wrote:<br>
<br>
>Sorry for all the recent posts, but after running MythTV since 2011, the<br>
>upgrade to 29/16.04 has tossed a few curveballs at me. Most things have<br>
>been smooth but there's a few small issues, perhaps due to the fact that<br>
>the previous Mythbuntu ISO install handled so many tasks for you.<br>
><br>
>In order to start the mythfrontend on my combined FE/BE at boot I added the<br>
>mythfrontend command to Sessions and Starup. But it's hit and miss as to<br>
>whether it starts up before the backend/mysql are fully up. If it starts<br>
>before then, even the subsequent retries seem to be failing the dbawake<br>
>test, even though mythbackend is running and connected to mysql.<br>
><br>
>Looking at<br>
><a href="https://www.mythtv.org/wiki/Configuring_Frontend#Starting_the_Frontend" rel="noreferrer" target="_blank">https://www.mythtv.org/wiki/<wbr>Configuring_Frontend#Starting_<wbr>the_Frontend</a>, I<br>
>don't see any mention of scripting the startup.<br>
><br>
>Should the Frontend be started with systemd instead and if so is there a<br>
>recommended service file that waits for the backend and mysql to be fully<br>
>functioning before starting mythfrontend?<br>
><br>
>Thanks.<br>
<br>
</div></div>Mythfrontend is normally started in Mythbuntu by the X session<br>
startup. In 16.04 with XFCE4, that is found in:<br>
<br>
Applications > Settings > Session and Startup > Application Autostart<br>
<br>
There should have an entry in that list for "MythTV Frontend". Editing<br>
mine shows that it runs "mythfrontend --service". Since X starts<br>
pretty late, MySQL or MariaDB should be up and running well before<br>
that. If they are not, then that is the problem to debug I think, not<br>
trying to make mythfrontend start from systemd instead of X.<br>
<br>
If you really need to know if the database is running, then you can<br>
use a script that logs into mythconverg and does a query. If that<br>
fails, then the database is not up and the script should wait say one<br>
second and try again. I believe the systemd way of having a service<br>
wait for a script is to run that script as a service itself, and then<br>
run the mythfrontend service only after the script service starts<br>
successfully.<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br></div></div></blockquote><div><br></div><div>Stephen:</div><div><br></div><div>I did the Application Autostart method before I started this thread and that's where I was getting a hit or miss of the frontend being able to connect..</div><div><br></div><div>Bill:</div><div><br></div><div>Your version of the systemd file worked, well, the first time The "Attempting to connect" came up briefly, the progress bar got about a third of the way across and then the menu screem.</div><div><br></div><div>Waited a few minutes and rebooted to see if it would start again. This time the progress bar went all the way across and failed.</div></div></div></div>