| 1 |
.\" $Id: scanbm.man 190 2013-09-02 06:19:37Z wimalopaan $ |
| 2 |
.TH scanbm 8 "02 Jan 2013" "scanbd 1.92" "Scanner button daemon" |
| 3 |
.IX scanbm |
| 4 |
.SH NAME |
| 5 |
scanbm\- User scanning support daemon for scanbd / scanbd manager |
| 6 |
.SH SYNOPSIS |
| 7 |
.B scanbm |
| 8 |
.B [\-c |
| 9 |
.I configfile |
| 10 |
.BI [\-d [debuglevel] |
| 11 |
.B ] [\-s] |
| 12 |
.B [\-t |
| 13 |
.I device |
| 14 |
.B \-a |
| 15 |
.I action |
| 16 |
.B ] |
| 17 |
.TP |
| 18 |
.B scanbd |
| 19 |
.B \-m |
| 20 |
.B [\-c |
| 21 |
.I configfile |
| 22 |
.BI [\-d [debuglevel] |
| 23 |
.B ] [\-s] |
| 24 |
.B [\-t |
| 25 |
.I device |
| 26 |
.B \-a |
| 27 |
.I action |
| 28 |
.B ] |
| 29 |
.SH DESCRIPTION |
| 30 |
.B scanbm |
| 31 |
is a companion to scanbd, |
| 32 |
a scanner button monitoring daemon that can trigger execution of scripts when |
| 33 |
a button is pressed. |
| 34 |
.PP |
| 35 |
scanbm is actually a (symbolic) link to scanbd and can be called as |
| 36 |
.B scanbm |
| 37 |
or |
| 38 |
.B scanbd -m. |
| 39 |
.PP |
| 40 |
scanbd (the scanner button daemon) opens and polls the scanner |
| 41 |
and therefore locks the device. So no other application can access the device |
| 42 |
directly (open the /dev/..., or via libusb, etc). |
| 43 |
.PP |
| 44 |
To enable scanning from applications, we use scanbm as a manager for scanbd. |
| 45 |
scanbm is a "proxy" for saned to access the scanner from an application. scanbm |
| 46 |
listens for requests on the saned network port. |
| 47 |
All applications therefore need to use the "net backend to access a scanner. |
| 48 |
.PP |
| 49 |
If a scan request arrives to scanbm on the sane-port, scanbm |
| 50 |
requests the scanbd scanner polling daemon to interrupt polling and to release the |
| 51 |
device by sending it a |
| 52 |
dbus-message (default) or a posix-signal (SIGUSR1) (signal-mode). |
| 53 |
It then starts the real saned which does the scanning and sends the data back |
| 54 |
to the requesting application. When the scanning is done and saned exits, scanbm |
| 55 |
requests scanbd to restart the polling by sending a second dbus-message (or the |
| 56 |
posix-signal SIGUSR2) and ends execution. |
| 57 |
The polling scanbd now re-enables polling of the devices. |
| 58 |
.PP |
| 59 |
scanbm is meant to be started from |
| 60 |
.B inetd, xinetd or systemd. |
| 61 |
Unlike saned it does not support stand-alone mode. |
| 62 |
.PP |
| 63 |
.B Note: |
| 64 |
Please note that the scanbm acts as a proxy to saned, |
| 65 |
all scanner applications must be configured to use the sane "net" |
| 66 |
backend to access the scanner. Direct access will not be possible. |
| 67 |
.PP |
| 68 |
.SH OPTIONS |
| 69 |
.TP |
| 70 |
.BI \-c " configfile" " \-\-config" =configfile |
| 71 |
Use |
| 72 |
.I configfile |
| 73 |
instead of the default /etc/scanbd/scanbd.conf configuration file. |
| 74 |
.TP |
| 75 |
.BI \-d [debuglevel] " \-\-debug" [=debuglevel] |
| 76 |
turn debug mode on. If specified, set the debug level to |
| 77 |
.I debuglevel |
| 78 |
.RS |
| 79 |
.br |
| 80 |
1 = error |
| 81 |
.br |
| 82 |
2 = warn |
| 83 |
.br |
| 84 |
3 = info |
| 85 |
.br |
| 86 |
4 - 7 = debug) |
| 87 |
.RE |
| 88 |
.TP |
| 89 |
.B \-s --signal |
| 90 |
use signals SIGUSR1/ SIGUSR2 instead of dbus messages to request the |
| 91 |
polling scanbd to stop / restart polling |
| 92 |
.TP |
| 93 |
.BI \-t " device " --trigger =device |
| 94 |
Trigger action for |
| 95 |
.I device |
| 96 |
(numerical) |
| 97 |
.TP |
| 98 |
.BI \-a " action " --action =action |
| 99 |
.I action |
| 100 |
(numerical) to be triggered |
| 101 |
.SH SCANBD/SCANBM CONFIGURATION |
| 102 |
scanbd and scanbm are configured trough scanbd.conf (/etc/scanbd/scanbd.conf or |
| 103 |
the file pointed out by the |
| 104 |
.B \-c <config-file> |
| 105 |
) |
| 106 |
.SH NETWORK SETUP FOR SCANBM |
| 107 |
scanbm must be setup very similar to the way saned must be setup. |
| 108 |
Note that your inetd must support IPv6 if you |
| 109 |
want to connect to scanbm over IPv6 ; xinetd, openbsd-inetd and systemd are known to |
| 110 |
support IPv6, check the documentation for your inetd daemon. |
| 111 |
.SH INETD CONFIGURATION |
| 112 |
For |
| 113 |
.B scanbm |
| 114 |
it is also necessary to add a configuration line to |
| 115 |
.IR /etc/inetd.conf |
| 116 |
just like it is for saned. |
| 117 |
.PP |
| 118 |
The configuration line normally looks like this: |
| 119 |
.PP |
| 120 |
.RS |
| 121 |
sane\-port stream tcp nowait scanbd.scanbd /usr/sbin/scanbm scanbm |
| 122 |
.RE |
| 123 |
.PP |
| 124 |
However, if your system uses |
| 125 |
.BR tcpd (8) |
| 126 |
for additional security screening, you may want to disable saned |
| 127 |
access control by putting ``+'' in |
| 128 |
.IR saned.conf |
| 129 |
(see |
| 130 |
.IR saned (8) |
| 131 |
) and use a line of the following form in |
| 132 |
.IR /etc/inetd.conf |
| 133 |
instead: |
| 134 |
.PP |
| 135 |
.RS |
| 136 |
sane\-port stream tcp nowait scanbd.scanbd /usr/sbin/tcpd /usr/sbin/scanbm |
| 137 |
.RE |
| 138 |
.PP |
| 139 |
Note that both examples assume that there is a |
| 140 |
.B scanbd |
| 141 |
group and a |
| 142 |
.B scanbd |
| 143 |
user. If you follow this example, please make sure that the |
| 144 |
access permissions on the special device are set such that |
| 145 |
.B scanbd and saned |
| 146 |
can access the scanner (the programs generally need read and |
| 147 |
write access to scanner devices). |
| 148 |
.PP |
| 149 |
If xinetd is installed on your system instead of inetd the following example |
| 150 |
for xinetd.conf may be helpful: |
| 151 |
.PP |
| 152 |
.RS |
| 153 |
.ft CR |
| 154 |
.nf |
| 155 |
# default: off |
| 156 |
# description: The sane server accepts requests |
| 157 |
# for network access to a local scanner via the |
| 158 |
# network. |
| 159 |
service sane\-port |
| 160 |
{ |
| 161 |
port = 6566 |
| 162 |
socket_type = stream |
| 163 |
wait = no |
| 164 |
user = scanbd |
| 165 |
group = scanbd |
| 166 |
server = /usr/sbin/scanbm |
| 167 |
server_args = |
| 168 |
} |
| 169 |
.fi |
| 170 |
.ft R |
| 171 |
.RE |
| 172 |
.PP |
| 173 |
Finally, it is also necessary to add a line of the following form to |
| 174 |
.IR /etc/services : |
| 175 |
.PP |
| 176 |
.RS |
| 177 |
sane\-port 6566/tcp # SANE network scanner daemon |
| 178 |
.RE |
| 179 |
.PP |
| 180 |
The official IANA short name for port 6566 is "sane\-port". The older name "sane" |
| 181 |
is now deprecated. |
| 182 |
.RE |
| 183 |
.PP |
| 184 |
scanbm does not do access control, but it relies on the access control done by |
| 185 |
saned. |
| 186 |
.SH "SEE ALSO" |
| 187 |
.BR scanbd (8), |
| 188 |
.BR sane (7), |
| 189 |
.BR saned (8), |
| 190 |
.BR sane\-dll (5), |
| 191 |
.BR sane\-net (5) |
| 192 |
.br |
| 193 |
.I http://http://scanbd.sourceforge.net/ |
| 194 |
.SH AUTHOR |
| 195 |
Louis Lagendijk |