Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Why can't I discover my network scanner with xinetd? SOLVED
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 210
Location: Utility Muffin Research Kitchen

PostPosted: Thu Mar 14, 2019 2:25 am    Post subject: Why can't I discover my network scanner with xinetd? SOLVED Reply with quote

I would like to scan over my network.

My server returns:
Code:
$ scanimage -L
device `epkowa:interpreter:002:004' is a Epson GT-S640 flatbed scanner

My client however has problems. If I run saned on the server, scanimage -L on the client discovers a scanner as above. If however I start saned on the server with xinetd, scanimage -L on the client returns No scanners were identified. That is, I can discover my scanner from my client with /etc/init.d/saned start on the server, but not /etc/init.d/xinetd start. Why?

Code:
# cat /etc/xinetd.d/saned
service sane-port
{
  socket_type = stream
  server = /usr/sbin/saned
  protocol = tcp
  user = saned
  group = scanner
  only_from = 192.168.1.0/24
  wait = no
  disable = no
}


Code:
# SANE_DEBUG_NET=128 scanimage -L #client with xinetd on the server
[sanei_debug] Setting debug level of net to 128.
[net] sane_init: authorize != null, version_code != null
[net] sane_init: SANE net backend version 1.0.14 (AF-indep) from sane-backends 1.0.27
[net] sane_init: Client has little endian byte order
[net] sane_init: searching for config file
[net] sane_init: trying to add server_machine
[net] add_device: adding backend server_machine
[net] add_device: backend server_machine 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_machine
[net] connect_dev: [0] connection succeeded (IPv4)
[net] connect_dev: sanei_w_init
[net] connect_dev: net_init (user=root, 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)

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).
[net] sane_exit: exiting
[net] sane_exit: closing dev 0x556d1cbb5ac0, ctl=3
[net] sane_exit: finished.


Code:
tail -n 6 /var/log/messages
Mar 14 13:20:15 server_machine xinetd[16679]: START: sane-port from=192.168.1.26
Mar 14 13:20:15 server_machine saned[18778]: saned (IPv4 only) from sane-backends 1.0.27 starting up
Mar 14 13:20:15 server_machine saned[18778]: check_host: access by remote host: 192.168.1.26
Mar 14 13:20:15 server_machine saned[18778]: init: access granted to root@192.168.1.26
Mar 14 13:20:15 server_machine saned[18778]: saned exiting
Mar 14 13:20:15 server_machine xinetd[16679]: EXIT: sane-port status=0 duration=0(sec)


Last edited by Fog_Watch on Fri Mar 15, 2019 12:01 am; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7241
Location: almost Mile High in the USA

PostPosted: Thu Mar 14, 2019 3:47 pm    Post subject: Reply with quote

You will need to run saned as a daemon directly without inetd if you want to autodetect. Saned will also respond to broadcast discovery requests that xinetd will ignore. I don't think there is a good workaround with xinetd, unless you want to manually specify the machine with the scanner attached.

(perhaps enabling zeroconf might be an option, I don't know... been using saned as a daemon directly.)
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 210
Location: Utility Muffin Research Kitchen

PostPosted: Thu Mar 14, 2019 10:57 pm    Post subject: Reply with quote

eccerr0r wrote:
You will need to run saned as a daemon directly without inetd if you want to autodetect.

This was yesterday's experience. However, xinetd on the server and scanimage -L on the client did work up until about a year ago (maybe two years ago). I don't know what's changed.
Back to top
View user's profile Send private message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 210
Location: Utility Muffin Research Kitchen

PostPosted: Fri Mar 15, 2019 12:00 am    Post subject: Reply with quote

I had the wrong user and wrong server_args. The following works:

Code:
# cat /etc/xinetd.d/saned
service sane-port
{
  socket_type = stream
  server = /usr/sbin/saned
  protocol = tcp
  user = root
  server_args = "-a saned"
  only_from = 192.168.1.0/24
  wait = no
  disable = no
}
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7241
Location: almost Mile High in the USA

PostPosted: Fri Mar 15, 2019 2:43 am    Post subject: Reply with quote

Well, if you specify "-a" in xinetd, then it basically runs it as a standalone server. Though something still baffles me as xinetd would be listening to the port and you should get a conflict...

Anyway, something needs to be constantly running for discovery, then the client programs won't then need to "nmap" your network for scan servers and thus know what your network configuration is not to mention being slow.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum