[mythtv-users] Starting mythfrontend with systemd?

Ian Evans dheianevans at gmail.com
Fri Oct 6 02:49:23 UTC 2017

On Thu, Oct 5, 2017 at 10:37 PM, Stephen Worthington <
stephen_agent at jsw.gen.nz> wrote:

> On Wed, 4 Oct 2017 17:53:06 -0400, you wrote:
> >Sorry for all the recent posts, but after running MythTV since 2011, the
> >upgrade to 29/16.04 has tossed a few curveballs at me. Most things have
> >been smooth but there's a few small issues, perhaps due to the fact that
> >the previous Mythbuntu ISO install handled so many tasks for you.
> >
> >In order to start the mythfrontend on my combined FE/BE at boot I added
> the
> >mythfrontend command to Sessions and Starup. But it's hit and miss as to
> >whether it starts up before the backend/mysql are fully up. If it starts
> >before then, even the subsequent retries seem to be failing the dbawake
> >test, even though mythbackend is running and connected to mysql.
> >
> >Looking at
> >https://www.mythtv.org/wiki/Configuring_Frontend#Starting_the_Frontend, I
> >don't see any mention of scripting the startup.
> >
> >Should the Frontend be started with systemd instead and if so is there a
> >recommended service file that waits for the backend and mysql to be fully
> >functioning before starting mythfrontend?
> >
> >Thanks.
> Mythfrontend is normally started in Mythbuntu by the X session
> startup.  In 16.04 with XFCE4, that is found in:
> Applications > Settings > Session and Startup > Application Autostart
> There should have an entry in that list for "MythTV Frontend". Editing
> mine shows that it runs "mythfrontend --service".  Since X starts
> pretty late, MySQL or MariaDB should be up and running well before
> that.  If they are not, then that is the problem to debug I think, not
> trying to make mythfrontend start from systemd instead of X.
> If you really need to know if the database is running, then you can
> use a script that logs into mythconverg and does a query.  If that
> fails, then the database is not up and the script should wait say one
> second and try again.  I believe the systemd way of having a service
> wait for a script is to run that script as a service itself, and then
> run the mythfrontend service only after the script service starts
> successfully.

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


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.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20171005/ed140c73/attachment.html>

More information about the mythtv-users mailing list