sane-backends: rebind printers to usblp after scan

While scanning, sane unbinds usb device from usblp module. This
patch creates a saned wrapper that keep track of all usb devices
binded to usblp before saned is launched and rebind them back
if not still bound after saned exits.

This workaround is only effective if saned is launched by a super
daemon like xinetd as it needs to exit after scan job finish. If
not, printing will not be available while saned service is running.

Write access to /sys/bus/usb/drivers/usblp/bind is required. So,
normally it would require root access.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
This commit is contained in:
Luiz Angelo Daros de Luca
2019-04-30 01:32:59 -03:00
parent fedc5cf5a4
commit 7dd2e1776e
3 changed files with 30 additions and 4 deletions
@@ -0,0 +1,14 @@
# default: off
# description: The saned provides scanner service via the network. \
# Applications like kooka, xsane or xscanimage can use the remote \
# scanner.
service sane-port
{
socket_type = stream
port = 6566
wait = no
user = root
group = root
server = /usr/sbin/saned
disable = yes
}