[mythtv-users] starting with systemd was Who's running Myth on Arch, and what do you think?

Aaron Russell aaron at therussells.me
Tue Nov 26 15:12:43 UTC 2013


On Tue, Nov 26, 2013 at 8:02 AM, <mythtv at phipps-hutton.freeserve.co.uk>wrote:

>
> Quoting James Linder <jam at tigger.ws>:
>
>  Indeed it does work, but since it is almost exactly what I already had
>> more spelunking was called for:
>>
>> Despite everything systemd DOES NOT wait for the devices to be ready !!
>>
>> The real magic occurs here
>> Restart=on-failure
>>
>> and indeed I have two log files ... The first at boot time saying failure
>> ... the second a short time later say all-is-well
>>
>>
> I doubt systemd is capable of waiting for a device to be ready, that would
> require it to know how to operate every possible device and have the
> knowledge to work out what constitutes ready. So it is probably waiting for
> the device file to exist. The device file is created by udev so the problem
> may lie there. I don't know how udev operates but it may be creating the
> device at the same time as it loads the kernel module.
>
> Looking through /var/log/dmesg on my system I see the em28xx module print
> it's first message at 5.339s and the last message for tuner 0 at 6.703s. I
> have three tuners and the last message for the last tuner is at 7.199s.
> There are enough gaps in that sequence for mythbackend to start and fail.
>
> I think your best bet is to live with the failure/restart. Anything else
> is going to add more complexity. Or you could just add a sleep to the
> mythbackend startup.
>
> Cheers,
> Tim.
>
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users



I use systemd with mythtv. I have mythtv wait for my capture card because
otherwise mythtv starts to early and it doesn't show up.

I have a udev rule.
#
## Create systemd device units for capture devices
##
SUBSYSTEM=="video4linux", TAG+="systemd"
SUBSYSTEM=="dvb", TAG+="systemd"
SUBSYSTEM=="firewire", TAG+="systemd"

This allows me to wait for my device in mythbackend systemd service file.

[Unit]
Description=MythTV Backend
After=network.target mysqld.service
After=dev-dvb-adapter0-frontend0.device
# Uncomment the following line if you will be using the mythweb plugin on
the
# same system as mythbackend.
#Wants=apache2.service
# wait for slow capture card
Wants=dev-dvb-adapter0-frontend0.device
[Service]
Type=simple
#Environment=HOME=/var/lib/mythtv
User=mythtv
ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv


[Install]
WantedBy=multi-user.target
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20131126/730c8b1e/attachment.html>


More information about the mythtv-users mailing list