/lib/systemd/system/<unit name>.service
/etc/systemd/system
not /lib/systemd/system
?sudo systemctl enable application.service
Restart Always
in service has limits. Kill 'em limits:
[unit]
add StartLimitIntervalSec=0
so systemd will continue to try to restart the service forever[Service]
add RestartSec=1
to have systemd retry every second (instead of the default every 100ms)lsusb
or usbreset
will both give you this information/etc/udev/rules.d
for example /etc/udev/rules.d/80-local.rules
and put in it something like this example:ACTION=="add", ATTR{idVendor}=="0582", ATTR{idProduct}=="01d6", TAG+="systemd", ENV{SYSTEMD_WANTS}="jackd.service"
Example
/etc/udev/rules.d/20-usb-bus.rules
with content: KERNEL=="usb[1-2]", TAG+="systemd"
systemctl status dev-bus-usb-001-001.device
[Unit]
you can do something like After=dev-bus-usb-001-001.device dev-bus-usb-002-001.device