<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 5, 2017 at 5:01 AM, Darac Marjal <span dir="ltr"><<a href="mailto:mailinglist@darac.org.uk" target="_blank">mailinglist@darac.org.uk</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 Thu, Oct 05, 2017 at 09:44:23AM +0100, Darac Marjal wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On Thu, Oct 05, 2017 at 03:08:39AM +0200, 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>
<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>
<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>
<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>
<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>
<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>
I hate to be cruel, but it's advice like this which made sysvinit the slow, clunky nightmare that it was. Why five seconds? If the database is ready, why wait? What if the database is doing repairs, will five seconds be enough?<br>
<br>
The following should be a suitable start:<br>
<br>
[Unit]<br>
Description=the open source DVR, MythTV<br>
After=graphical-session.target<br>
</blockquote>
<br></div></div>
Bah. The whole point of this was to wait for the database, wasn't it? Add:<br>
After=mysql.service<span class="gmail-im gmail-HOEnZb"><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
BindsTo=graphical-session.targ<wbr>et<br>
<br>
[Service]<br>
Environment=DISPLAY=%i<br>
ExecStart=/usr/bin/mythfronten<wbr>d<br>
<br>
[Install]<br>
WantedBy=graphical-session.tar<wbr>get<br>
<br>
This should start mythtv when you log in (WantedBy) and kill mythtv when you log out (BindsTo). Save this as /etc/systemd/system/mythtv@.se<wbr>rvice, then run "systemctl enable mythtv@:0.service" for display :0.<br>
<br></blockquote></span></blockquote><div><br></div><div>Created the file with:</div><div><br></div><div> [Unit]</div><div> Description=the open source DVR, MythTV</div><div> After=mysql.service</div><div> BindsTo=graphical-session.target</div><div><br></div><div> [Service]</div><div> Environment=DISPLAY=%i</div><div> ExecStart=/usr/bin/mythfrontend</div><div><br></div><div> [Install]</div><div> WantedBy=graphical-session.target </div><div><br></div><div>Then ran systemctl enable mythtv@:0.service<br></div><div><br></div><div>Rebooted and the frontend didn't start. did a journalctl -b | grep myth and it shows the backend starting up but not the frontend.</div><div><br></div><div>Thanks.</div></div></div></div>