Add a native service file and hook it up in the shutdown.target. That's the cleanest solution.
/etc/systemd/system/foo.service [Unit] Description=Run service on shutdown
[Service] ExecStart=/bin/true
[Install] WantedBy=shutdown.target
Add a native service file and hook it up in the shutdown.target. That's the cleanest solution.
/etc/systemd/ system/ foo.service
[Unit]
Description=Run service on shutdown
[Service]
ExecStart=/bin/true
[Install] shutdown. target
WantedBy=