Use udev+systemd to start the service, implement shutdown