Actually, I have two lines of rules in my rules.d folder:

SUBSYSTEM=="tty", ATTRS{idVendor}=="23b8", ATTRS{idProduct}=="0005", SYMLINK+="ttyACM-Daruma", MODE="0777"
SUBSYSTEM=="tty", ATTRS{idVendor}=="1753", ATTRS{idProduct}=="c902", SYMLINK+="ttyACM-Gertec", MODE="0777"

These persistant symbolic links are used by my POS application and are working fine, but I need to create another rule to execute a custom shell script wheen the user insert the first device (ttyACM-Daruma). Is there any way to achieve this task?

  • man udev, have a look at RUN, in particular the restrictions. If your custom shell script needs to anything outside the restrictions, you'll have to start the script from some kind of demon, and contact the demon in the RUN script. – dirkt Mar 13 at 17:47
  • To be more specific, I need to kill all Wine applications using "wineserver -k" when the user power off the printer (USB device). After that, I need to restart the applications when the user power on the printer. – hofmanng96 Mar 13 at 19:40
  • Restarting applications definitely won't work, so I'd go with the "write a demon to do the real work, trigger it from an udev script" approach. – dirkt Mar 14 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.