<div><div dir="auto">Hi Ralf,</div></div><div><br><div class="gmail_quote"><div dir="ltr">On Sun, 2 Sep 2018 at 11:40 pm, Ralf Sieger <<a href="mailto:Ralf.Sieger@gmx.net">Ralf.Sieger@gmx.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Verdana;font-size:12.0px"><div>Hi,</div>
<div> </div>
<div>I want my system to pause on shutdown to wait till my backup has finished if it is running.</div>
<div>For this I've created this small service:</div>
<div> </div>
<div>
<div>[Unit]<br>
Description=borg shutdown wait</div>
<div>[Service]<br>
Type=oneshot<br>
ExecStart=/bin/true<br>
RemainAfterExit=true</div>
<div>ExecStop=/usr/local/bin/wait_borg<br>
TimeoutStopSec=600</div>
<div>[Install]<br>
WantedBy=multi-user.target</div>
<div> </div>
<div>I'm using ubuntu 18.04, systemd 237</div>
<div> </div>
<div>Manually stopping the service via</div>
<div>systemctl stop borg_wrapper</div>
<div>does wait and thus works.</div>
<div> </div>
<div>But its not working on normal shutdown/poweroff ...</div>
<div>From the logs I can't even see an entry with</div>
<div>"Stopping borg shutdown wait" in syslog.</div>
<div> </div>
<div>Does anyone has an idea?</div></div></div></div></blockquote><div dir="auto"><br></div><div dir="auto">I had to achieve something similar a while back and this is how I ended up doing: </div><div dir="auto"><br></div><div dir="auto"><div dir="auto"><a href="https://echorand.me/doing-something-before-systemd-shuts-your-supervisord-down.html">https://echorand.me/doing-something-before-systemd-shuts-your-supervisord-down.html</a></div><div dir="auto"><br></div><div dir="auto">Hope it helps.</div><div dir="auto"><br></div><div dir="auto"><br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Verdana;font-size:12.0px"><div><div></div>
<div> </div>
</div>
<div class="m_-3488603434558054402signature">Regards,<br>
<br>
Ralf</div></div></div>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
</blockquote></div></div>