You are not logged in.

#1 2017-07-09 02:53:03

bobpaul
Member
Registered: 2012-02-11
Posts: 26

client can't see scanner on host (scanner server) [SOLVED, PATCHED]

I'm having the same symptoms as this older question but the proposed answer seems to no longer apply. As far as I can tell, saned.socket runs saned as root (there isn't even a saned user anymore), so there should be no permissions problems. If I run scanimage -L on the server it shows my scanner. I can also launch xsane on the server and scan documents.

From the server, I can watch systemctl status saned.socket and it shows "connected=1" briefly every time I run scanimage -L on the client. This is also true if I use Windows clients (ex SaneTwain, SwingSane). Everything connects briefly to the server but nothing sees the scanner.

My scanner is an HP All in One that I setup with hplib's hp-setup.

Edit: tl;dr - the instructions on the wiki are correct, but SANED requires a source code patch before it can share some (any?) network scanners. I guess this makes sense as you wouldn't want multiple saneds on the same network segmet detecting and re-sharing each other's scanners. But it should probably be a setting...

Last edited by bobpaul (2017-07-13 02:11:30)

Offline

#2 2017-07-09 10:30:41

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: client can't see scanner on host (scanner server) [SOLVED, PATCHED]

Have you tried connecting the alternative hpaio protocol as described on https://wiki.archlinux.org/index.php/SA … c_problems ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2017-07-09 17:37:13

bobpaul
Member
Registered: 2012-02-11
Posts: 26

Re: client can't see scanner on host (scanner server) [SOLVED, PATCHED]

Sane on the server CAN talk to the HP scanner already, though. It's just the remote sane clients that can't see the scanner through saned on the server. If I understand the wiki, that alternate procedure is for when sane isn't able to talk to the scanner in the first place.  I thought if sane on the server can see the scanner, then saned should be able to share the scanner just fine.

On the server:

server $ scanimage -L
device `hpaio:/net/HP_LaserJet_3052?hostname=printer' is a Hewlett-Packard HP_LaserJet_3052 all-in-one
server $ cat /etc/saned.conf
localhost
192.168.2.0/24
server $ systemctl status saned.socket

● saned.socket - saned incoming socket
   Loaded: loaded (/usr/lib/systemd/system/saned.socket; enabled; vendor preset: disabled)
   Active: active (listening) since Sat 2017-07-08 21:42:45 CDT; 14h ago
   Listen: [::]:6566 (Stream)
 Accepted: 5; Connected: 0
server $ lsmod | grep sane
nf_conntrack_sane      16384  0
nf_conntrack          110592  1 nf_conntrack_sane

On a remote client (also an archlinux box)

client $ $ scanimage -L
device `v4l:/dev/video0' is a Noname Integrated Camera virtual device
client $ grep net /etc/sane.d/dll.conf 
# enable the next line if you want to allow access through the network:
net
client $ cat /etc/sane.d/net.conf
connect_timeout = 60
192.168.2.250

I CAN get the remote archlinux client to talk directly to the scanner, just like I have with the server. But this whole exercise is getting saned sharing the scanner so that I can have a windows client connect with SaneTwain. This is an older scanner that's no longer supported on Windows. Sane for windows doesn't support device drivers; only remotely connecting to saned on a posix system.

Last edited by bobpaul (2017-07-09 17:45:01)

Offline

#4 2017-07-10 11:09:51

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: client can't see scanner on host (scanner server) [SOLVED, PATCHED]

I've searched a bit and found several references where people needed to install/configure xinetd on the server to allow windows clients to access saned correctly.
The saned(8) manpage also mentions inetd.

Do you have xinetd installed/running ?


https://unix.stackexchange.com/question … device-i-o
http://wizjos.diskstation.me/synology/i … et-je-syno (in dutch, but does show an xinetd config example)

Last edited by Lone_Wolf (2017-07-10 11:10:17)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2017-07-12 04:17:44

bobpaul
Member
Registered: 2012-02-11
Posts: 26

Re: client can't see scanner on host (scanner server) [SOLVED, PATCHED]

Yeah, I saw mention of xinetd, too. I have it running, but had it configured as follows:

$ cat /etc/xinetd.d/sane 
service sane-port
{
	port        = 6566
	socket_type = stream
	wait        = no
	user        = root
	group       = scanner
	server      = /usr/bin/saned
	# disabled by default!
	disable     = yes
		  }
}

Derp! disable = yes!?! Clearly I was just copy/pasting.... A quick check at the xinetd journal showed "disabling service sane-port".

I don't think I should have the saned.socket and xinetd running at the same time. It looks like they both do the same thing; listen on the port and start saned if a connection arrives. So I disabled the socket, fixed the sane-port config, and restarted xinetd. *

$ journalctl -u xinetd 
....
Jul 11 23:05:40 bobpaul xinetd[8427]: Reading included configuration file: /etc/xinetd.d/rsh [file=/etc/xinetd.d/rsh] [line=10]
Jul 11 23:05:40 bobpaul xinetd[8427]: Reading included configuration file: /etc/xinetd.d/rsync [file=/etc/xinetd.d/rsync] [line=10]
Jul 11 23:05:40 bobpaul xinetd[8427]: Reading included configuration file: /etc/xinetd.d/sane [file=/etc/xinetd.d/sane] [line=11]
Jul 11 23:05:40 bobpaul xinetd[8427]: Reading included configuration file: /etc/xinetd.d/servers [file=/etc/xinetd.d/servers] [line=11]
Jul 11 23:05:40 bobpaul xinetd[8427]: Reading included configuration file: /etc/xinetd.d/services [file=/etc/xinetd.d/services] [line=10]
Jul 11 23:05:40 bobpaul xinetd[8427]: Reading included configuration file: /etc/xinetd.d/svn [file=/etc/xinetd.d/svn] [line=10]
Jul 11 23:05:40 bobpaul xinetd[8427]: Reading included configuration file: /etc/xinetd.d/talk [file=/etc/xinetd.d/talk] [line=11]
Jul 11 23:05:40 bobpaul xinetd[8427]: Reading included configuration file: /etc/xinetd.d/telnet [file=/etc/xinetd.d/telnet] [line=10]
Jul 11 23:05:40 bobpaul xinetd[8427]: Reading included configuration file: /etc/xinetd.d/tftp [file=/etc/xinetd.d/tftp] [line=10]
Jul 11 23:05:40 bobpaul xinetd[8427]: removing login
Jul 11 23:05:40 bobpaul xinetd[8427]: removing shell
Jul 11 23:05:40 bobpaul xinetd[8427]: removing rsync
Jul 11 23:05:40 bobpaul xinetd[8427]: removing servers
Jul 11 23:05:40 bobpaul xinetd[8427]: removing services
Jul 11 23:05:40 bobpaul xinetd[8427]: removing svn
Jul 11 23:05:40 bobpaul xinetd[8427]: removing ntalk
Jul 11 23:05:40 bobpaul xinetd[8427]: removing telnet
Jul 11 23:05:40 bobpaul xinetd[8427]: removing tftp
Jul 11 23:05:40 bobpaul xinetd[8427]: xinetd Version 2.3.15 started with no options compiled in.
Jul 11 23:05:40 bobpaul xinetd[8427]: Started working: 1 available service
Jul 11 23:06:13 bobpaul xinetd[8427]: START: sane-port pid=8498 from=192.168.2.10
Jul 11 23:06:13 bobpaul saned[8498]: saned (AF-indep+IPv6) from sane-backends 1.0.27 starting up
Jul 11 23:06:13 bobpaul saned[8498]: check_host: access by remote host: 192.168.2.10
Jul 11 23:06:13 bobpaul saned[8498]: init: access granted to saned-user@192.168.2.10
Jul 11 23:06:25 bobpaul saned[8498]: saned exiting
Jul 11 23:06:34 bobpaul xinetd[8427]: START: sane-port pid=8545 from=192.168.2.10
Jul 11 23:06:34 bobpaul saned[8545]: saned (AF-indep+IPv6) from sane-backends 1.0.27 starting up
Jul 11 23:06:34 bobpaul saned[8545]: check_host: access by remote host: 192.168.2.10
Jul 11 23:06:34 bobpaul saned[8545]: init: access granted to saned-user@192.168.2.10
Jul 11 23:06:45 bobpaul saned[8545]: saned exiting

At the bottom of that log you can see where I twice ran "scanimage -L" on the archlinux client. The client still shows no scanner identified.

I watched

$ watch ps aux \| grep saned

and when saned runs, it's definitely running as root.

Edit * Indeed, with xinetd listening on the saned port, if I start the saned.socket service it fails with address already in use.

Last edited by bobpaul (2017-07-12 04:20:33)

Offline

#6 2017-07-12 04:53:48

bobpaul
Member
Registered: 2012-02-11
Posts: 26

Re: client can't see scanner on host (scanner server) [SOLVED, PATCHED]

With xinetd and saned.socket disabled and stopped, I tried running saned directly and got the following: (I added # comments and some blank lines to separate)

$ sudo saned -d128
[saned] read_config: searching for config file
[saned] read_config: done reading config
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.27 starting up
[saned] do_bindings: trying to get port for service "sane-port" (getaddrinfo)
[saned] do_bindings: [1] socket () using IPv6
[saned] do_bindings: [1] setsockopt ()
[saned] do_bindings: [1] bind () to port 6566
[saned] do_bindings: [1] listen ()
[saned] do_bindings: [0] socket () using IPv4
[saned] do_bindings: [0] setsockopt ()
[saned] do_bindings: [0] bind () to port 6566
[saned] do_bindings: [0] bind failed: Address already in use   # <--- ?? What? Is this a problem? netstat -net shows 6566 is not open before I start saned, and the connection proceeds below, but... 
[saned] run_standalone: spawning Avahi process
[saned] run_standalone: waiting for control connection
[saned] saned_avahi_callback: AVAHI_CLIENT_S_RUNNING
[saned] saned_create_avahi_services: adding service 'saned'
[saned] saned_avahi_group_callback: service 'saned' successfully established

#Now I tried running scanimage -L on the client

[saned] handle_connection: processing client connection
[saned] check_host: detected an IPv4-mapped address
[saned] check_host: access by remote host: ::ffff:192.168.2.10
[saned] check_host: remote host is not IN_LOOPBACK nor IN6_LOOPBACK
[saned] check_host: local hostname: bobpaul
[saned] check_host: local hostname(s) (from DNS): localhost.localdomain
[saned] check_host: local hostname(s) (from DNS): (null)
[saned] check_host: local hostname(s) (from DNS): (null)
[saned] check_host: local hostname(s) (from DNS): (null)
[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.conf'
[saned] check_host: config file line: `# Configuration for the saned daemon'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `## Daemon options'
[saned] check_host: config file line: `# Port range for the data connection. Choose a range inside [1024 - 65535].'
[saned] check_host: config file line: `# Avoid specifying too large a range, for performance reasons.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# ONLY use this if your saned server is sitting behind a firewall. If your'
[saned] check_host: config file line: `# firewall is a Linux machine, we strongly recommend using the'
[saned] check_host: config file line: `# Netfilter nf_conntrack_sane connection tracking module instead.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# data_portrange = 10000 - 10100'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `## Access list'
[saned] check_host: config file line: `# A list of host names, IP addresses or IP subnets (CIDR notation) that'
[saned] check_host: config file line: `# are permitted to use local SANE devices. IPv6 addresses must be enclosed'
[saned] check_host: config file line: `# in brackets, and should 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: `localhost'
[saned] check_host: DNS lookup returns IP address: ::1
[saned] check_host: DNS lookup returns IP address: ::1
[saned] check_host: DNS lookup returns IP address: ::1
[saned] check_host: DNS lookup returns IP address: 127.0.0.1
[saned] check_host: DNS lookup returns IP address: 127.0.0.1
[saned] check_host: DNS lookup returns IP address: 127.0.0.1
[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.10 (in subnet 192.168.2.0/24)   # <--- Client connected and was granted access
[saned] init: access granted
[saned] init: access granted to saned-user@::ffff:192.168.2.10
[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] bailing out, waiting for children...
[saned] bail_out: all children exited     # <--- that seems like a problem

I see this same issue was reported in 2014 on the Ubuntu bug tracker. It was reported again in 2016 with a patch. I guess I'll try the patch.

Offline

#7 2017-07-12 05:43:24

bobpaul
Member
Registered: 2012-02-11
Posts: 26

Re: client can't see scanner on host (scanner server) [SOLVED, PATCHED]

That fixed it! I built my own package from abs after patching exactly as mike Bernson suggests.. I'm now able to scan with xsane on the remote client. I expect Windows will work now, too.

I've uploaded a src tarbal which includes the patch if anyone needs it. I'll have to talk to upstream or at least the arch package maintainer to figure out why this is needed and if it should be default.

Offline

Board footer

Powered by FluxBB