Actually there may be an even better solution:
Before=shutdown.target
which lintian has been nagging us about:
https://lintian.debian.org/tags/systemd-service-file-shutdown-problems
"There is race condition between stopping units and systemd getting a request to exit the main loop, so it may proceed with shutdown before all pending stop jobs have been processed."
Actually there may be an even better solution:
Before= shutdown. target
which lintian has been nagging us about:
https:/ /lintian. debian. org/tags/ systemd- service- file-shutdown- problems
"There is race condition between stopping units and systemd getting a request to exit the main loop, so it may proceed with shutdown before all pending stop jobs have been processed."