I have the following systemd unit:[Unit]Description=PulseAudio Hotplug Service[Service]Type=oneshotEnvironment=DISPLAY=:0User=%iExecStart=/usr/local/bin/autopulse switchStandardOutput=journalI have the following udev rule triggering it:SUBSYSTEMS==usb, ATTRS{idVendor}==0d8c, ATTRS{idProduct}==1066, ENV{SYSTEMD_WANTS}=autopulse@naftuli.service, TAG+=systemdThe service is a oneshot service, so my script runs successfully whenever the given device is plugged in. However, I need specifically that the script be run again when the device is removed.I have tried setting RemainOnExit=yes, but this results in systemd only starting the service once and never stopping it. I have also played around with adding ExecStop and ExecStopPost clauses, but it still does not run when the device is removed.Is there a way for me to have systemd stop a unit or start another unit when this device is removed?
Stop systemd Service on Device Removal
systemd;udev