• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Configuring `saned` as a service
2================================
3
4To launch `saned` automatically in response to an incoming connection,
5configure it as a service managed by `inetd`, `xinetd`, or `systemd`.
6
7First verify that /etc/services contains a line of the following form:
8
9    sane-port 6566/tcp # SANE network scanner daemon
10
11If not, then add it. (The name "sane-port" has been assigned by IANA.)
12
13
14The examples below assume there is a "saned" group and a "saned" user.
15Make sure that the ACLs on the scanner device files are set such that
16`saned` can access them for reading and writing.
17
18
19`inetd` Configuration
20---------------------
21
22Configure `inetd` if your platform does not use `systemd` or `xinetd`.
23Not all `inetd` implementations support IPv6; check its documentation.
24
25Add a line in /etc/inetd.conf like the following:
26
27    sane-port stream tcp nowait saned.saned /usr/local/sbin/saned saned
28
29
30`xinetd` Configuration
31----------------------
32
33Copy frontend/saned.xinetd.conf into the `xinetd` configuration files
34directory (as /etc/xinetd.d/saned.conf).
35
36
37`systemd` Configuration
38-----------------------
39
40Copy frontend/saned.socket and frontend/saned@.service into one of the
41system-wide directories for unit files (/etc/systemd/system/).
42
43The recommended way to adjust the service settings is with the command
44`systemctl edit saned@`. This opens a file inside a text editor where
45overrides may be entered. As an example, environment variables can be
46set which are used to control debug logging in individual backends:
47
48    [Service]
49    Environment=SANE_DEBUG_DLL=255
50    Environment=SANE_DEBUG_BJNP=5
51
52(Refer to the man pages of the appropriate backends for more details.)
53
54It is recommended to build SANE with explicit `systemd` support, which
55allows log messages from `saned` to be written to the journal. If SANE
56is built without this support, the following override must be used:
57
58    [Service]
59    StandardInput=socket
60