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