[systemd-devel] blocking service on shutdown
Amit Saha
amitsaha.in at gmail.com
Sun Sep 2 22:04:18 UTC 2018
Hi Ralf,
On Sun, 2 Sep 2018 at 11:40 pm, Ralf Sieger <Ralf.Sieger at gmx.net> wrote:
> Hi,
>
> I want my system to pause on shutdown to wait till my backup has finished
> if it is running.
> For this I've created this small service:
>
> [Unit]
> Description=borg shutdown wait
> [Service]
> Type=oneshot
> ExecStart=/bin/true
> RemainAfterExit=true
> ExecStop=/usr/local/bin/wait_borg
> TimeoutStopSec=600
> [Install]
> WantedBy=multi-user.target
>
> I'm using ubuntu 18.04, systemd 237
>
> Manually stopping the service via
> systemctl stop borg_wrapper
> does wait and thus works.
>
> But its not working on normal shutdown/poweroff ...
> From the logs I can't even see an entry with
> "Stopping borg shutdown wait" in syslog.
>
> Does anyone has an idea?
>
I had to achieve something similar a while back and this is how I ended up
doing:
https://echorand.me/doing-something-before-systemd-shuts-your-supervisord-down.html
Hope it helps.
> Regards,
>
> Ralf
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180903/91753311/attachment.html>
More information about the systemd-devel
mailing list