This used to be really simple, you could just use a device uri like
usb:/dev/usb/lp0. Unfortunately, this has been deliberately removed. It can be enabled again by replacing just a line that signals failure with the open of the device file, but it requires a recompile of the usb backend.
If you want to avoid the recompile, you can try the
parallel backend, if that doesn't work, you can always use the
pipe backend. With the
pipe backend you can send the print data so a simple script that essentially does
cat > /dev/usb/lp0.
Then you just need a print queue assigned to that backend, and scripts called from
udevd that enable and disable this queue on USB connect and disconnect. I seems you already have these scripts. Samba will automatically see the print queue if it is configured with CUPS support.
This assumes that you want to use any single printer. The printers you want to plug in should use the same control language, such as PCL.
If you want more than one printer at the same time, it is slightly more difficult, if you are interested, I can expand on that.
pipe are some of the CUPS backends. The
parallel backend is meant for parallel printer ports, using devices
/dev/lp3. Using a device uri of
parallel:/dev/usb/lp0 could work, as the device interface should be quite similar. The
pipe backend is used with a script
pipe:/path/to/script. The script gets the data on stdin and can do whatever is necessary. In this case it has to send the data to
pipe backend may be a SUSE extension.
To configure Samba for CUPS, you mainly have to specify
printing = cups in
udevd, place a file in
/etc/udev/rules.d with the content
KERNEL=="lp*", ACTION=="add|remove", RUN+="/usr/local/sbin/udev-cups.sh"
/usr/local/sbin/udev-cups.sh can be similar to this:
case "$ACTION" in