scanbm(8) | Scanner button daemon | scanbm(8) |
scanbm- User scanning support daemon for scanbd / scanbd manager
scanbm [-c configfile [-d[debuglevel] ] [-s] [-t device -a action ]
scanbm is a companion to scanbd, a scanner button monitoring daemon that can trigger execution of scripts when a button is pressed.
scanbm is actually a (symbolic) link to scanbd and can be called as scanbm or scanbd -m.
scanbd (the scanner button daemon) opens and polls the scanner and therefore locks the device. So no other application can access the device directly (open the /dev/..., or via libusb, etc).
To enable scanning from applications, we use scanbm as a manager for scanbd. scanbm is a "proxy" for saned to access the scanner from an application. scanbm listens for requests on the saned network port. All applications therefore need to use the "net backend to access a scanner.
If a scan request arrives to scanbm on the sane-port, scanbm requests the scanbd scanner polling daemon to interrupt polling and to release the device by sending it a dbus-message (default) or a posix-signal (SIGUSR1) (signal-mode). It then starts the real saned which does the scanning and sends the data back to the requesting application. When the scanning is done and saned exits, scanbm requests scanbd to restart the polling by sending a second dbus-message (or the posix-signal SIGUSR2) and ends execution. The polling scanbd now re-enables polling of the devices.
scanbm is meant to be started from inetd, xinetd or systemd. Unlike saned it does not support stand-alone mode.
Note: Please note that the scanbm acts as a proxy to saned, all scanner applications must be configured to use the sane "net" backend to access the scanner. Direct access will not be possible.
scanbd and scanbm are configured trough scanbd.conf (/etc/scanbd/scanbd.conf or the file pointed out by the -c <config-file> )
scanbm must be setup very similar to the way saned must be setup. Note that your inetd must support IPv6 if you want to connect to scanbm over IPv6 ; xinetd, openbsd-inetd and systemd are known to support IPv6, check the documentation for your inetd daemon.
For scanbm it is also necessary to add a configuration line to /etc/inetd.conf just like it is for saned.
The configuration line normally looks like this:
However, if your system uses tcpd(8) for additional security screening, you may want to disable saned access control by putting ``+'' in saned.conf (see saned(8) ) and use a line of the following form in /etc/inetd.conf instead:
Note that both examples assume that there is a scanbd group and a scanbd user. If you follow this example, please make sure that the access permissions on the special device are set such that scanbd and saned can access the scanner (the programs generally need read and write access to scanner devices).
If xinetd is installed on your system instead of inetd the following example for xinetd.conf may be helpful:
# default: off # description: The sane server accepts requests # for network access to a local scanner via the # network. service sane-port {
port = 6566
socket_type = stream
wait = no
user = scanbd
group = scanbd
server = /usr/sbin/scanbm
server_args = }
Finally, it is also necessary to add a line of the following form to /etc/services:
The official IANA short name for port 6566 is
"sane-port". The older name "sane" is now deprecated.
scanbm does not do access control, but it relies on the access control done by saned.
scanbd(8), sane(7), saned(8),
sane-dll(5), sane-net(5)
http://http://scanbd.sourceforge.net/
Louis Lagendijk
02 Jan 2013 | scanbd 1.92 |