Note that in the first rule the systemd-escape command has NO "-p" option and that the %c for ENV{SYSTEMD_WANTS} has extra single quotes. Compared to the original file only these single quotes got added.
After restarting UDEV with
sudo udevadm control --reload
and re-plugging the printer in most cases the service does not get started.
systemctl status 'udev-configure-printer@-devices-pci0000:00-0000:00:14.0-usb2-2\x2d2.service' > status.txt
and this starts correctly udev-configure printer which sets up the printer (and starts ippusbxd if needed).
In some very few cases the service actually gets correctly started (and the printer set up) when one plugs the printer, but this happens rarely (can there be some kind of race condition?).
So this only rarely happening automatic start of the printer setup service is now the problem. The escaping seems to be fixed by the extra single quotes.
It seems that with a 70-printers.rules as follows at least a correct service name is generated
---------- =="usb_ device" , ENV{ID_ USB_INTERFACES} =="*:0701? ?:*", TAG+="udev- configure- printer" , TAG+="systemd", PROGRAM= "/bin/systemd- escape --template= udev-configure- printer@ .service %p", ENV{SYSTEMD_ WANTS}+ ="'%c'" =="usb_ device" , ENV{ID_ USB_INTERFACES} =="*:0701* :*", RUN+="udev- configure- printer remove %p"
# Low-level USB device add trigger
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}
# Low-level USB device remove trigger
ACTION=="remove", SUBSYSTEM=="usb", ENV{DEVTYPE}
----------
Note that in the first rule the systemd-escape command has NO "-p" option and that the %c for ENV{SYSTEMD_WANTS} has extra single quotes. Compared to the original file only these single quotes got added.
After restarting UDEV with
sudo udevadm control --reload
and re-plugging the printer in most cases the service does not get started.
systemctl status 'udev-configure -printer@ -devices- pci0000: 00-0000: 00:14.0- usb2-2\ x2d2.service' > status.txt
gives something like
---------- printer@ devices- pci0000: 00-0000: 00:14.0- usb2-2\ x2d2.service - Automatic USB/Bluetooth printer setup (devices- pci0000: 00-0000: 00:14.0- usb2-2\ x2d2) system/ udev-configure- printer@ .service; static; vendor preset: enabled)
● udev-configure-
Loaded: loaded (/lib/systemd/
Active: inactive (dead)
----------
In such a case one can start the service manually with
sudo systemctl start 'udev-configure -printer@ -devices- pci0000: 00-0000: 00:14.0- usb2-2\ x2d2.service'
and this starts correctly udev-configure printer which sets up the printer (and starts ippusbxd if needed).
In some very few cases the service actually gets correctly started (and the printer set up) when one plugs the printer, but this happens rarely (can there be some kind of race condition?).
So this only rarely happening automatic start of the printer setup service is now the problem. The escaping seems to be fixed by the extra single quotes.