1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | [Unit] Description=some job [Service] Type=oneshot ExecStart=/usr/bin/script [Install] WantedBy=shutdown.target reboot.target halt.target poweroff.target ---previous tries--- [Unit] Description=some job (also tried 'Before=umount.target) (also tried 'DefaultDependencies=no') [Service] Type=oneshot (also tried 'forking') RemainAfterExit=true ExecStart=/usr/bin/script ExecStop=/usr/bin/script [Install] WantedBy=shutdown.target reboot.target halt.target umount.target |