<div dir="ltr">On Thu, Oct 15, 2015 at 8:34 PM, Jerome Yuzyk <span dir="ltr"><<a href="mailto:jerome@supernet.ab.ca" target="_blank">jerome@supernet.ab.ca</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thursday, October 15, 2015 08:40:31 PM Rich Freeman wrote:<br>
> On Thu, Oct 15, 2015 at 8:15 PM, Jerome Yuzyk <<a href="mailto:jerome@supernet.ab.ca">jerome@supernet.ab.ca</a>> wrote:<br>
> > # Whether systemd will continue over-watch and restart on any halt<br>
> > #Restart=always<br>
> ><br>
> > Does this work?<br>
><br>
> Yes.<br>
><br>
> cat /etc/systemd/system/mythbackend.service.d/00rich.conf<br>
><br>
> [Unit]<br>
> After=mariadb-contain.service mariadb-wait-online@mariadb.service<br>
> nss-lookup.target<br>
> Wants=mariadb-wait-online@mariadb.service<br>
><br>
> [Service]<br>
> Nice=-5<br>
> IOSchedulingClass=1<br>
> Restart=always<br>
><br>
> (it is better to override units in /etc/systemd/system instead of<br>
> modifying the ones in /usr/lib, which will not be cfg-protected<br>
> anyway)<br>
><br>
> You won't need most of that. You can just drop everything but<br>
> [Service] and Restart=always. The scheduling stuff might be useful to<br>
> anybody, and the rest is just dependencies on my own units since my<br>
> database is inside a container.<br>
><br>
> Everything but the [Unit] stuff should be distro-agnostic as well.<br>
<br>
</span>Excellent, thanks! I've been reading a bit more of <a href="http://www.freedesktop.org/software/systemd/man/systemd.service.html" rel="noreferrer" target="_blank">http://www.freedesktop.org/software/systemd/man/systemd.service.html</a><br>
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.<br>
<br>
Hika: That's a very tidy way of doing it!<br>
<span class="im HOEnZb"></span></blockquote><div><br></div><div>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. <br></div></div></div></div>