[mythtv-users] auto-restarting mythbackend
Frank Phillips
frankalso at gmail.com
Fri Oct 16 14:20:28 UTC 2015
On Thu, Oct 15, 2015 at 8:34 PM, Jerome Yuzyk <jerome at supernet.ab.ca> wrote:
> 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!
>
Another pro tip: once you copy a unit file to /etc/systemd/system for
editing, you can use systemd-delta to see the changes you've made.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20151016/27127782/attachment.html>
More information about the mythtv-users
mailing list