[mythtv-users] auto-restarting mythbackend

Jerome Yuzyk jerome at supernet.ab.ca
Fri Oct 16 01:34:55 UTC 2015


On Thursday, October 15, 2015 08:40:31 PM Rich Freeman wrote:
> On Thu, Oct 15, 2015 at 8:15 PM, Jerome Yuzyk <jerome at supernet.ab.ca> wrote:
> > # Whether systemd will continue over-watch and restart on any halt
> > #Restart=always
> >
> > Does this work?
> 
> Yes.
> 
> cat /etc/systemd/system/mythbackend.service.d/00rich.conf
> 
> [Unit]
> After=mariadb-contain.service mariadb-wait-online at mariadb.service
> nss-lookup.target
> Wants=mariadb-wait-online at mariadb.service
> 
> [Service]
> Nice=-5
> IOSchedulingClass=1
> Restart=always
> 
> (it is better to override units in /etc/systemd/system instead of
> modifying the ones in /usr/lib, which will not be cfg-protected
> anyway)
> 
> You won't need most of that.  You can just drop everything but
> [Service] and Restart=always.  The scheduling stuff might be useful to
> anybody, and the rest is just dependencies on my own units since my
> database is inside a container.
> 
> Everything but the [Unit] stuff should be distro-agnostic as well.

Excellent, thanks! I've been reading a bit more of http://www.freedesktop.org/software/systemd/man/systemd.service.html
and there are several Restart= options, one of which is "on-failure". That might be better targeted to abnormal endings? I start/stop mythbackend to do mythtv-setup (running that a lot lately)  so I probably don't want to always auto-restart it.

Hika: That's a very tidy way of doing it!

-- 
A little of Jerome's MythTV World: http://mythtv.bss.ab.ca


More information about the mythtv-users mailing list