[mythtv-users] Starting mythfrontend with systemd?
Ian Evans
dheianevans at gmail.com
Thu Oct 5 20:04:23 UTC 2017
On Thu, Oct 5, 2017 at 5:01 AM, Darac Marjal <mailinglist at darac.org.uk>
wrote:
> On Thu, Oct 05, 2017 at 09:44:23AM +0100, Darac Marjal wrote:
>
>> On Thu, Oct 05, 2017 at 03:08:39AM +0200, 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.
>>>
>>
>> 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?
>>
>> The following should be a suitable start:
>>
>> [Unit]
>> Description=the open source DVR, MythTV
>> After=graphical-session.target
>>
>
> Bah. The whole point of this was to wait for the database, wasn't it? Add:
> After=mysql.service
>
>> BindsTo=graphical-session.target
>>
>> [Service]
>> Environment=DISPLAY=%i
>> ExecStart=/usr/bin/mythfrontend
>>
>> [Install]
>> WantedBy=graphical-session.target
>>
>> This should start mythtv when you log in (WantedBy) and kill mythtv when
>> you log out (BindsTo). Save this as /etc/systemd/system/mythtv at .service,
>> then run "systemctl enable mythtv@:0.service" for display :0.
>>
>>
Created the file with:
[Unit]
Description=the open source DVR, MythTV
After=mysql.service
BindsTo=graphical-session.target
[Service]
Environment=DISPLAY=%i
ExecStart=/usr/bin/mythfrontend
[Install]
WantedBy=graphical-session.target
Then ran systemctl enable mythtv@:0.service
Rebooted and the frontend didn't start. did a journalctl -b | grep myth and
it shows the backend starting up but not the frontend.
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20171005/e18ff1b2/attachment.html>
More information about the mythtv-users
mailing list