[mythtv-users] Starting mythfrontend with systemd?

Ian Evans dheianevans at gmail.com
Thu Oct 5 15:09:59 UTC 2017


On Wed, Oct 4, 2017 at 10:44 PM, Bill Meek <keemllib at gmail.com> wrote:

> On 10/04/2017 08:08 PM, Hika van den Hoven wrote:
>
>> Hoi Ian,
>>
>> Wednesday, October 4, 2017, 11:53:06 PM, 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.
>>>
>>
>> If you want to be sure the backend is up add a sleep command to your
>> frontend startup script. Like sleep 5 to wait 5 seconds, which should
>> be more then enough.
>>
>
> To be sure the backend is up and running (not still starting up)
> consider the following, probably without the echos:
>
> ATTEMPTS=20
> BACKEND='yourBackendHostNameOrIP'
>
> for TRIES in $(seq $ATTEMPTS); do
>     curl --silent --max-time 1 $BACKEND:6544/Myth/GetHostName > /dev/null
>     if [ $? = 0 ]; then
>         echo "$BACKEND is up"
>         break
>     fi
>     echo "Waiting for $BACKEND..."
> done
>
>
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.

Ran /home/ian/mythfrontendstart.sh from the terminal and it started fine.

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


More information about the mythtv-users mailing list