Mailing List Archive

MythTV 0.28 and systemd and Ubuntu 15.10 (wily) or 16.04 (xenial)
Hi Guys

Since Ubuntu 16.04 (Xenial) is not yet ready I am trying 0.28 with
15.10 (Wily).

I installed xubuntu 15.10 and installed mythtv 0.28 from ppa:mythbuntu/0.28

It looks like it is still trying to use Upstart, but Upstart has now
been replaced by systemd. The backend is not starting up. It still is
using a script in /etc/init/

Am I missing something here?

I am trying to get up to speed with systemd. As far as I can see we need
a script in /etc/systemd/system/ and we need to run "sudo systemctl
enable service-name.service". Can I help with getting this set up? I
can create a script and test it then send it on to you for including in
place of the upstart script?

Peter



_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: MythTV 0.28 and systemd and Ubuntu 15.10 (wily) or 16.04 (xenial) [ In reply to ]
You can use my systemd service file I've been using for years on RPM Fusion
and modify it as needed...

http://cvs.rpmfusion.org/viewvc/rpms/mythtv/devel/mythbackend.service?revision=1.10&root=free&view=markup

Thanks,
Richard
Re: MythTV 0.28 and systemd and Ubuntu 15.10 (wily) or 16.04 (xenial) [ In reply to ]
On 01/07/2016 03:11 PM, Peter Bennett wrote:
> Hi Guys
>
> Since Ubuntu 16.04 (Xenial) is not yet ready I am trying 0.28 with
> 15.10 (Wily).
>
> I installed xubuntu 15.10 and installed mythtv 0.28 from ppa:mythbuntu/0.28
>
> It looks like it is still trying to use Upstart, but Upstart has now
> been replaced by systemd. The backend is not starting up. It still is
> using a script in /etc/init/
>
> Am I missing something here?
>
> I am trying to get up to speed with systemd. As far as I can see we need
> a script in /etc/systemd/system/ and we need to run "sudo systemctl
> enable service-name.service". Can I help with getting this set up? I
> can create a script and test it then send it on to you for including in
> place of the upstart script?

Hi,

I'm running Ubuntu 15.10 and 0.28-pre.

1st, make sure you don't already a .service file for MythTV, I've
worked with users that did:

systemctl cat --no-pager mythtv-backend

If not, or if you want to adjust the one that's in /lib/systemd/system/...
then adding it to /etc/systemd/system/ as you said above is right. I've been
learning about it too and here's mine:

$ systemctl cat --no-pager mythtv-backend.service # /etc/systemd/system/mythtv-backend.service
# Useful commands, the 2nd set requires root privs.
# systemctl cat --no-pager mythtv-backend
# systemctl status mythtv-backend
# systemctl is-enabled mythtv-backend
#
# systemctl enable mythtv-backend
# systemctl daemon-reload
# systemctl reload mythtv-backend
# systemctl start mythtv-backend
# systemctl stop mythtv-backend

[Unit]
Description=MythTV Backend
Documentation=https://www.mythtv.org/wiki/Mythbackend
# TODO: Add TAG+="systemd" to the tuner udev rules and add to the next line.
After=mysqld.service network-online.target

[Service]
User=mythtv
EnvironmentFile=-/etc/mythtv/additional.args
ExecStartPre=/usr/bin/nm-online --quiet --timeout=5
ExecStart=/usr/local/bin/mythbackend --logpath /var/log/mythtv --quiet $ADDITIONAL_ARGS $MYTHTV_BE_OPTS
StartLimitBurst=10
StartLimitInterval=15m
Restart=on-failure
RestartSec=30

[Install]
WantedBy=multi-user.target

Pay attention to the output of systemctl status mythtv-backend. I've seen
users that were failing because the service wasn't enabled.

● mythtv-backend.service - MythTV Backend
Loaded: loaded (/etc/systemd/system/mythtv-backend.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2016-01-07 15:13:19 CST; 8min ago
Docs: https://www.mythtv.org/wiki/Mythbackend
Process: 1860 ExecStartPre=/usr/bin/nm-online --quiet --timeout=5 (code=exited, status=0/SUCCESS)
Main PID: 1926 (mythbackend)
CGroup: /system.slice/mythtv-backend.service
└─1926 /usr/local/bin/mythbackend --logpath /var/log/mythtv --quiet

Jan 07 15:13:19 ofc0 systemd[1]: Starting MythTV Backend...
Jan 07 15:13:19 ofc0 systemd[1]: Started MythTV Backend.

--
Bill
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: MythTV 0.28 and systemd and Ubuntu 15.10 (wily) or 16.04 (xenial) [ In reply to ]
On 07/01/16 22:11, Peter Bennett wrote:
> Hi Guys

> I am trying to get up to speed with systemd. As far as I can see we need
> a script in /etc/systemd/system/ and we need to run "sudo systemctl
> enable service-name.service". Can I help with getting this set up? I
> can create a script and test it then send it on to you for including in
> place of the upstart script?

Mythtv is packaged for many distributions using systemd; you could just
pick a service file from some such.

systemd is designed with the idea that such configuration files are
distro-agnostic, so it IMHO makes a lot of sense that they are shipped
by the upstream mythtv project.

On a sidenote, files shipped by an upstream like mythtv lives in
/lib/systemd/system; the /etc stuff is local overrides.

Cheers!

--alec

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: MythTV 0.28 and systemd and Ubuntu 15.10 (wily) or 16.04 (xenial) [ In reply to ]
On 01/07/2016 04:30 PM, Bill Meek wrote:
> On 01/07/2016 03:11 PM, Peter Bennett wrote:
>> Hi Guys
>>
>> Since Ubuntu 16.04 (Xenial) is not yet ready I am trying 0.28 with
>> 15.10 (Wily).
>>
>> I installed xubuntu 15.10 and installed mythtv 0.28 from
>> ppa:mythbuntu/0.28
>>
>> It looks like it is still trying to use Upstart, but Upstart has now
>> been replaced by systemd. The backend is not starting up. It still is
>> using a script in /etc/init/
>>
>> Am I missing something here?
>>
>> I am trying to get up to speed with systemd. As far as I can see we need
>> a script in /etc/systemd/system/ and we need to run "sudo systemctl
>> enable service-name.service". Can I help with getting this set up? I
>> can create a script and test it then send it on to you for including in
>> place of the upstart script?
>
> Hi,
>
> I'm running Ubuntu 15.10 and 0.28-pre.
>
> 1st, make sure you don't already a .service file for MythTV, I've
> worked with users that did:
>
> systemctl cat --no-pager mythtv-backend
>
> If not, or if you want to adjust the one that's in
> /lib/systemd/system/...
> then adding it to /etc/systemd/system/ as you said above is right.
> I've been
> learning about it too and here's mine:
>
> $ systemctl cat --no-pager mythtv-backend.service #
> /etc/systemd/system/mythtv-backend.service
> # Useful commands, the 2nd set requires root privs.
> # systemctl cat --no-pager mythtv-backend
> # systemctl status mythtv-backend
> # systemctl is-enabled mythtv-backend
> #
> # systemctl enable mythtv-backend
> # systemctl daemon-reload
> # systemctl reload mythtv-backend
> # systemctl start mythtv-backend
> # systemctl stop mythtv-backend
>
> [Unit]
> Description=MythTV Backend
> Documentation=https://www.mythtv.org/wiki/Mythbackend
> # TODO: Add TAG+="systemd" to the tuner udev rules and add to the next
> line.
> After=mysqld.service network-online.target
>
> [Service]
> User=mythtv
> EnvironmentFile=-/etc/mythtv/additional.args
> ExecStartPre=/usr/bin/nm-online --quiet --timeout=5
> ExecStart=/usr/local/bin/mythbackend --logpath /var/log/mythtv --quiet
> $ADDITIONAL_ARGS $MYTHTV_BE_OPTS
> StartLimitBurst=10
> StartLimitInterval=15m
> Restart=on-failure
> RestartSec=30
>
> [Install]
> WantedBy=multi-user.target
>
> Pay attention to the output of systemctl status mythtv-backend. I've seen
> users that were failing because the service wasn't enabled.
>
> ● mythtv-backend.service - MythTV Backend
> Loaded: loaded (/etc/systemd/system/mythtv-backend.service;
> enabled; vendor preset: enabled)
> Active: active (running) since Thu 2016-01-07 15:13:19 CST; 8min ago
> Docs: https://www.mythtv.org/wiki/Mythbackend
> Process: 1860 ExecStartPre=/usr/bin/nm-online --quiet --timeout=5
> (code=exited, status=0/SUCCESS)
> Main PID: 1926 (mythbackend)
> CGroup: /system.slice/mythtv-backend.service
> └─1926 /usr/local/bin/mythbackend --logpath /var/log/mythtv
> --quiet
>
> Jan 07 15:13:19 ofc0 systemd[1]: Starting MythTV Backend...
> Jan 07 15:13:19 ofc0 systemd[1]: Started MythTV Backend.
>
Thanks Bill this is very helpful. I see there is a service but it is
disabled. So I will try enabling it and move forward from there.

systemctl status mythtv-backend
● mythtv-backend.service - MythTV Backend
Loaded: loaded (/lib/systemd/system/mythtv-backend.service; disabled;
vendor preset: enabled)
Active: inactive (dead)

Peter
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: MythTV 0.28 and systemd and Ubuntu 15.10 (wily) or 16.04 (xenial) [ In reply to ]
On Fri, Jan 8, 2016 at 7:34 AM Peter Bennett <pgbennett@comcast.net> wrote:

> On 01/07/2016 04:30 PM, Bill Meek wrote:
> > On 01/07/2016 03:11 PM, Peter Bennett wrote:
> >> Hi Guys
> >>
> >> Since Ubuntu 16.04 (Xenial) is not yet ready I am trying 0.28 with
> >> 15.10 (Wily).
> >>
> >> I installed xubuntu 15.10 and installed mythtv 0.28 from
> >> ppa:mythbuntu/0.28
> >>
> >> It looks like it is still trying to use Upstart, but Upstart has now
> >> been replaced by systemd. The backend is not starting up. It still is
> >> using a script in /etc/init/
> >>
> >> Am I missing something here?
> >>
> >> I am trying to get up to speed with systemd. As far as I can see we need
> >> a script in /etc/systemd/system/ and we need to run "sudo systemctl
> >> enable service-name.service". Can I help with getting this set up? I
> >> can create a script and test it then send it on to you for including in
> >> place of the upstart script?
> >
> > Hi,
> >
> > I'm running Ubuntu 15.10 and 0.28-pre.
> >
> > 1st, make sure you don't already a .service file for MythTV, I've
> > worked with users that did:
> >
> > systemctl cat --no-pager mythtv-backend
> >
> > If not, or if you want to adjust the one that's in
> > /lib/systemd/system/...
> > then adding it to /etc/systemd/system/ as you said above is right.
> > I've been
> > learning about it too and here's mine:
> >
> > $ systemctl cat --no-pager mythtv-backend.service #
> > /etc/systemd/system/mythtv-backend.service
> > # Useful commands, the 2nd set requires root privs.
> > # systemctl cat --no-pager mythtv-backend
> > # systemctl status mythtv-backend
> > # systemctl is-enabled mythtv-backend
> > #
> > # systemctl enable mythtv-backend
> > # systemctl daemon-reload
> > # systemctl reload mythtv-backend
> > # systemctl start mythtv-backend
> > # systemctl stop mythtv-backend
> >
> > [Unit]
> > Description=MythTV Backend
> > Documentation=https://www.mythtv.org/wiki/Mythbackend
> > # TODO: Add TAG+="systemd" to the tuner udev rules and add to the next
> > line.
> > After=mysqld.service network-online.target
> >
> > [Service]
> > User=mythtv
> > EnvironmentFile=-/etc/mythtv/additional.args
> > ExecStartPre=/usr/bin/nm-online --quiet --timeout=5
> > ExecStart=/usr/local/bin/mythbackend --logpath /var/log/mythtv --quiet
> > $ADDITIONAL_ARGS $MYTHTV_BE_OPTS
> > StartLimitBurst=10
> > StartLimitInterval=15m
> > Restart=on-failure
> > RestartSec=30
> >
> > [Install]
> > WantedBy=multi-user.target
> >
> > Pay attention to the output of systemctl status mythtv-backend. I've seen
> > users that were failing because the service wasn't enabled.
> >
> > ● mythtv-backend.service - MythTV Backend
> > Loaded: loaded (/etc/systemd/system/mythtv-backend.service;
> > enabled; vendor preset: enabled)
> > Active: active (running) since Thu 2016-01-07 15:13:19 CST; 8min ago
> > Docs: https://www.mythtv.org/wiki/Mythbackend
> > Process: 1860 ExecStartPre=/usr/bin/nm-online --quiet --timeout=5
> > (code=exited, status=0/SUCCESS)
> > Main PID: 1926 (mythbackend)
> > CGroup: /system.slice/mythtv-backend.service
> > └─1926 /usr/local/bin/mythbackend --logpath /var/log/mythtv
> > --quiet
> >
> > Jan 07 15:13:19 ofc0 systemd[1]: Starting MythTV Backend...
> > Jan 07 15:13:19 ofc0 systemd[1]: Started MythTV Backend.
> >
> Thanks Bill this is very helpful. I see there is a service but it is
> disabled. So I will try enabling it and move forward from there.
>
> systemctl status mythtv-backend
> ● mythtv-backend.service - MythTV Backend
> Loaded: loaded (/lib/systemd/system/mythtv-backend.service; disabled;
> vendor preset: enabled)
> Active: inactive (dead)
>
> Peter
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org


There are 3 issues that I'm aware of that I'm currently investigating fixes
for.

1) mythtv-backend isn't set to start at boot. This actually looks fairly
trivial to fix as there is a dh_ script to assist with enabling this. I've
just pushed this fix to the 0.28 packaging.
2) mysql listens on localhost only due to their config file. There is a new
conf file in mysql that gets read after ours making mysql listen on
localhost only. It would be bad for us to edit their config file, so I'm
not sure the best way to fix this.
3) The database we ship doesn't work quite right without firing off
mythtv-setup first. I think I've got a handle on this, just need some time
to fix this.
--
Thomas Mashos