[sane-devel] saned and xinetd

Fred. Oger fred.oger at gmail.com
Sun Feb 8 14:25:49 UTC 2009


Hi all,

I'm trying to set up a shared scanner using saned to use it through my
private network. While it works like a charm when started in debug mode
(-d), I can't find my scanner (an HP PSC 1510) when stated through (x)inetd

Here's my setup:

The server (called server) has the scanner
The client (called frog) tries to connect

Server setup:

/etc/xinet.d/saned
 # default: off
              # description: The sane server accepts requests
              # for network access to a local scanner via the
              # network.
              service sane
              {
                 port        = 6566
                 socket_type = stream
		 protocol    = tcp
                 wait        = no
                 user        = saned
                 group       = saned
                 server      = /usr/sbin/saned
              }

/etc/services:
root at server:~# grep 6566 /etc/services
sane-port	6566/tcp	sane saned	# SANE network scanner daemon

/etc/sane.d/net.conf (for testing):
# This is the net config file.  Each line names a host to attach to.
# If you list "localhost" then your backends can be accessed either
# directly or through the net backend.  Going through the net backend
# may be necessary to access devices that need special privileges.
localhost

/etc/sane.d/saned.conf :
#
# saned.conf
#
# The contents of the saned.conf  file  is  a  list  of  host  names,  IP
# addresses or IP subnets (CIDR notation) that are permitted to use local
# SANE devices. IPv6 addresses must be enclosed in brackets,  and  should
# always  be specified in their compressed form.
#
# The hostname matching is not case-sensitive.
#
192.168.2.0/24

Client side :
fred at frog:~$ more /etc/sane.d/net.conf
# This is the net backend config file.

## net backend options
# Timeout for the initial connection to saned. This will prevent the backend
# from blocking for several minutes trying to connect to an unresponsive
# saned host (network outage, host down, ...). Value in seconds.
connect_timeout = 60

## saned hosts
# Each line names a host to attach to.
# If you list "localhost" then your backends can be accessed either
# directly or through the net backend.  Going through the net backend
# may be necessary to access devices that need special privileges.
# localhost
server

When I try to run scanimage when in debug mode

Server side:

root at server:~# /usr/sbin/saned -d255
[saned] main: starting debug mode (level 255)
[saned] main: trying to get port for service `sane-port' (getaddrinfo)
[saned] main: [0] socket () using IPv4
[saned] main: [0] setsockopt ()
[saned] main: [0] bind () to port 6566
[saned] main: [0] listen ()
[saned] main: [1] socket () using IPv6
[saned] main: [1] socket failed: Address family not supported by protocol
[saned] main: waiting for control connection
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.18-cvs ready
[saned] check_host: access by remote host: 192.168.2.2
[saned] check_host: remote host is not IN_LOOPBACK nor IN6_LOOPBACK
[saned] check_host: local hostname: server
[saned] check_host: local hostname(s) (from DNS): server
[saned] check_host: local hostname(s) (from DNS): (null)
[saned] check_host: local hostname(s) (from DNS): (null)
[saned] check_host: remote host doesn't have same addr as local
[saned] check_host: opening config file: /etc/hosts.equiv
[saned] check_host: can't open config file: /etc/hosts.equiv (No such
file or directory)
[saned] check_host: opening config file: saned.conf
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# saned.conf'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# The contents of the saned.conf
 file  is  a  list  of  host  names,  IP'
[saned] check_host: config file line: `# addresses or IP subnets (CIDR
notation) that are permitted to use local'
[saned] check_host: config file line: `# SANE devices. IPv6 addresses
must be enclosed in brackets,  and  should'
[saned] check_host: config file line: `# always  be specified in their
compressed form.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# The hostname matching is not
case-sensitive.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `192.168.2.0/24'
[saned] check_host: subnet with base IP = 192.168.2.0, CIDR netmask = 24
[saned] check_host: access granted from IP address 192.168.2.2 (in
subnet 192.168.2.0/24)
[saned] init: access granted
[saned] init: access granted to fred at 192.168.2.2
[saned] process_request: waiting for request
[saned] process_request: got request 1
[saned] process_request: waiting for request
[saned] process_request: got request 10
[saned] quit: exiting

Client Side:
fred at frog:~$ scanimage -L
device `v4l:/dev/video0' is a Noname USB 2.0 Camera virtual device
device `net:server:hpaio:/usb/PSC_1500_series?serial=MY586D92QD0498' is
a Hewlett-Packard PSC_1500_series all-in-one
fred at frog:~$ SANE_DEBUG_NET=255 scanimage -L
[sanei_debug] Setting debug level of net to 255.
[net] sane_init: authorize = 0x804d520, version_code = 0xbfb74728
[net] sane_init: SANE net backend version 1.0.14 (AF-indep+IPv6) from
sane-backends 1.0.19
[net] sane_init: Client has little endian byte order
[net] sane_init: searching for config file
[net] sane_init: connect timeout set to 60 seconds
[net] sane_init: trying to add server
[net] add_device: adding backend server
[net] add_device: backend server added
[net] sane_init: done reading config
[net] sane_init: evaluating environment variable SANE_NET_HOSTS
[net] sane_init: evaluating environment variable SANE_NET_TIMEOUT
[net] sane_init: done
[net] sane_get_devices: local_only = 0
[net] connect_dev: trying to connect to server
[net] connect_dev: [0] connection succeeded (IPv4)
[net] connect_dev: sanei_w_init
[net] connect_dev: net_init (user=fred, local version=1.0.3)
[net] connect_dev: freeing init reply (status=Success, remote version=1.0.3)
[net] connect_dev: done
[net] sane_get_devices: got
server:hpaio:/usb/PSC_1500_series?serial=MY586D92QD0498
[net] sane_get_devices: finished (1 devices)
device `v4l:/dev/video0' is a Noname USB 2.0 Camera virtual device
device `net:server:hpaio:/usb/PSC_1500_series?serial=MY586D92QD0498' is
a Hewlett-Packard PSC_1500_series all-in-one
[net] sane_exit: exiting
[net] sane_exit: closing dev 0x8093928, ctl=3
[net] sane_exit: finished.

While when run through xinetd

fred at frog:~$ SANE_DEBUG_NET=255 scanimage -L
[sanei_debug] Setting debug level of net to 255.
[net] sane_init: authorize = 0x804d520, version_code = 0xbf8373f8
[net] sane_init: SANE net backend version 1.0.14 (AF-indep+IPv6) from
sane-backends 1.0.19
[net] sane_init: Client has little endian byte order
[net] sane_init: searching for config file
[net] sane_init: connect timeout set to 60 seconds
[net] sane_init: trying to add server
[net] add_device: adding backend server
[net] add_device: backend server added
[net] sane_init: done reading config
[net] sane_init: evaluating environment variable SANE_NET_HOSTS
[net] sane_init: evaluating environment variable SANE_NET_TIMEOUT
[net] sane_init: done
[net] sane_get_devices: local_only = 0
[net] connect_dev: trying to connect to server
[net] connect_dev: [0] connection succeeded (IPv4)
[net] connect_dev: sanei_w_init
[net] connect_dev: net_init (user=fred, local version=1.0.3)
[net] connect_dev: freeing init reply (status=Success, remote version=1.0.3)
[net] connect_dev: done
[net] sane_get_devices: finished (0 devices)
device `v4l:/dev/video0' is a Noname USB 2.0 Camera virtual device
[net] sane_exit: exiting
[net] sane_exit: closing dev 0x8093928, ctl=3
[net] sane_exit: finished.


We only see the local camera but not the HP scanner. The only traces
found in the /var/adm/syslog on the server is :

Feb  8 15:23:10 server xinetd[5860]: xinetd Version 2.3.14 started with
libwrap loadavg options compiled in.
Feb  8 15:23:10 server xinetd[5860]: Started working: 1 available ervice
Feb  8 15:23:20 server saned[5861]: saned (AF-indep+IPv6) from
sane-backends 1.0.18-cvs ready
Feb  8 15:23:20 server saned[5861]: check_host: access by remote host:
192.168.2.2
Feb  8 15:23:20 server saned[5861]: init: access granted to
fred at 192.168.2.2
Feb  8 15:23:21 server saned[5861]: quit: exiting

Any idea ?

Best regards,

Fred. Oger



More information about the sane-devel mailing list