SYNOPSIS
scanbm [-c configfile [-d[debuglevel] ] [-s] [-t device -a action ]- scanbd
- -m [-c configfile [-d[debuglevel] ] [-s] [-t device -a action ]
DESCRIPTION
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.
OPTIONS
- -c configfile --config=configfile
- Use configfile instead of the default /etc/scanbd/scanbd.conf configuration file.
- -d[debuglevel] --debug[=debuglevel]
-
turn debug mode on. If specified, set the debug level to
debuglevel
-
1 = error
2 = warn
3 = info
4 - 7 = debug)
-
- -s --signal
- use signals SIGUSR1/ SIGUSR2 instead of dbus messages to request the polling scanbd to stop / restart polling
- -t device --trigger=device
- Trigger action for device (numerical)
- -a action --action=action
- action (numerical) to be triggered
SCANBD/SCANBM CONFIGURATION
scanbd and scanbm are configured trough scanbd.conf (/etc/scanbd/scanbd.conf or the file pointed out by the -c <config-file> )NETWORK SETUP FOR SCANBM
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.INETD CONFIGURATION
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:
- sane-port stream tcp nowait scanbd.scanbd /usr/sbin/scanbm scanbm
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:
- sane-port stream tcp nowait scanbd.scanbd /usr/sbin/tcpd /usr/sbin/scanbm
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:
- sane-port 6566/tcp # SANE network scanner daemon
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.
AUTHOR
Louis Lagendijk