saned over network. S: Wheezy, C: Squeeze

Einrichten des Druckers und des Drucksystems, Scannerkonfiguration und Software zum Scannen und Faxen.
Antworten
rzs19
Beiträge: 13
Registriert: 27.09.2011 22:30:55

saned over network. S: Wheezy, C: Squeeze

Beitrag von rzs19 » 13.04.2013 12:54:47

Hallo,

ich möchte meinen Scanner auch über das Netzwerk nutzen können,dies funktioniert leider nicht bzw. nur beim ersten Versuch (saned läuft standalone).

Server (Wheezy):

Code: Alles auswählen

server: ~# saned -d -a saned
[saned] main: starting debug mode (level 2)
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.22 starting up
[saned] do_bindings: [0] bind failed: Address already in use
[saned] check_host: access by remote host: ::ffff:192.168.19.30
[saned] init: access granted to saned-user@::ffff:192.168.19.30
[saned] bailing out, waiting for children...
[saned] bail_out: all children exited
Client (Squeeze):

Code: Alles auswählen

client: client: ~$ scanimage -L
device `v4l:/dev/video2' is a Noname UVC Camera (046d:0825) virtual device
device `v4l:/dev/video1' is a Noname WinTV PVR 500 (unit #2) virtual device
device `v4l:/dev/video0' is a Noname WinTV PVR 500 (unit #1) virtual device
device `net:192.168.19.4:hp5590:libusb:002:002' is a HP 5590 Workgroup scanner
Nutze ich xinetd oder inetd, dann funktioniert es garnicht. Auf dem Server gibt es keine Gruppe saned und auch keinen Usernamen saned - ich habe k.A warum.

Ich habe es nach dieser Anleitung nach probiert: http://wiki.debian.org/SaneOverNetwork .

xinetd:

Code: Alles auswählen

server: ~# cat /etc/xinetd.d/saned.conf
service sane-port
{
        socket_type = stream
        server = /usr/sbin/saned
        protocol = tcp
        user = saned
        group = saned
        wait = no
        disable = no
}
inetd:

Code: Alles auswählen

server: ~# cat /etc/inetd.conf | grep saned
sane-port stream tcp nowait saned.saned /usr/sbin/saned saned
xinetd und inetd laufen nicht parallel, sondern ich habe diese getrennt voneinander getestet.

Einen Eintrag in der "services" Datei gibt es auch:

Code: Alles auswählen

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

Code: Alles auswählen

server: ~# cat /etc/hosts.allow | grep 192.168.19
ALL: 192.168.19.0/24

Code: Alles auswählen

server: ~# cat /etc/sane.d/saned.conf | grep 192.168.19
192.168.19.0/24
Mit mehr Debug-Informationen.
Server (Wheezy) standalone:

Code: Alles auswählen

server: ~# saned -d128 -a saned
[saned] main: starting debug mode (level 128)
[saned] read_config: searching for config file
[saned] read_config: done reading config
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.22 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
[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
[saned] handle_connection: processing client connection
[saned] check_host: detected an IPv4-mapped address
[saned] check_host: access by remote host: ::ffff:192.168.19.30
[saned] check_host: remote host is not IN_LOOPBACK nor IN6_LOOPBACK
[saned] check_host: local hostname: samba
[saned] check_host: local hostname(s) (from DNS): samba.mammut.alice19
[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: `'
[saned] check_host: config file line: `#scan-client.somedomain.firm'
[saned] check_host: config file line: `#192.168.0.1'
[saned] check_host: config file line: `#192.168.0.1/29'
[saned] check_host: config file line: `#[2001:7a8:185e::42:12]'
[saned] check_host: config file line: `#[2001:7a8:185e::42:12]/64'
[saned] check_host: config file line: `192.168.19.0/24'
[saned] check_host: subnet with base IP = 192.168.19.0, CIDR netmask = 24
[saned] check_host: access granted from IP address 192.168.19.30 (in subnet 192.168.19.0/24)
[saned] init: access granted
[saned] init: access granted to saned-user@::ffff:192.168.19.30
[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
Client (Squeeze):

Code: Alles auswählen

client: ~$ SANE_DEBUG_NET=128 scanimage -L
[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+IPv6) from sane-backends 1.0.22
[net] sane_init: Client has little endian byte order
[net] sane_init: searching for config file
[net] sane_init: trying to add 192.168.19.4
[net] add_device: adding backend 192.168.19.4
[net] add_device: backend 192.168.19.4 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 192.168.19.4
[net] connect_dev: [0] connection succeeded (IPv4)
[net] connect_dev: sanei_w_init
[net] connect_dev: net_init (user=(null), 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 192.168.19.4:hp5590:libusb:002:002
[net] sane_get_devices: finished (1 devices)
device `v4l:/dev/video2' is a Noname UVC Camera (046d:0825) virtual device
device `v4l:/dev/video1' is a Noname WinTV PVR 500 (unit #2) virtual device
device `v4l:/dev/video0' is a Noname WinTV PVR 500 (unit #1) virtual device
device `net:192.168.19.4:hp5590:libusb:002:002' is a HP 5590 Workgroup scanner
[net] sane_exit: exiting
[net] net_avahi_cleanup: stopping thread
[net] net_avahi_cleanup: done
[net] sane_exit: closing dev 0xa7ed10, ctl=6
[net] sane_exit: finished.
Irgendwas mache ich wohl falsch?

LG,

Sciurus vulgaris

syssi
Beiträge: 2951
Registriert: 24.12.2010 16:50:59
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: Rheinland

Re: saned over network. S: Wheezy, C: Squeeze

Beitrag von syssi » 13.04.2013 16:01:39

Entscheidend ist folgende Fehlermeldung:

Code: Alles auswählen

[saned] do_bindings: [0] bind () to port 6566
[saned] do_bindings: [0] bind failed: Address already in use
Saned stellt fest, dass der Port 6566 schon von einem anderen Dienst gebunden ist (xinetd?). Deshalb wird kein anderer Rechner mit Netzwerk mit dem saned-Server sprechen koennen. Selbst setzt ich auf die xinet.d-Ansatz. Fuer den ersten Schritt koenntest du im Config-File als User und Gruppe "root" setzen:

Code: Alles auswählen

$ cat /etc/xinetd.d/saned.conf
service sane-port
{
        socket_type = stream
        server = /usr/sbin/saned
        protocol = tcp
        user = root
        group = root
        wait = no
        disable = no
}
Auf dem Client geht die IP des sane-Server in die net.conf. Restart der xinetd nicht vergessen. Wenn das Scannen erstmal funktioniert, kann man sich um den Feinschliff kuemmern (User/Gruppe anlegen, dafuer sorgen, dass dieser neue Benutzer ueberhaupt auf die Hardware zugreifen darf etc.).

Gruss syssi

rzs19
Beiträge: 13
Registriert: 27.09.2011 22:30:55

Re: saned over network. S: Wheezy, C: Squeeze

Beitrag von rzs19 » 13.04.2013 18:47:27

Frisches Setup: Host und Client sind nun beide Squeeze und benutzen Backports.

Code: Alles auswählen

server:~# ps ax | grep -E 'inetd|saned'
 4799 tty2     S+     0:00 grep -E inetd|saned
Es läuft kein xinetd oder inetd und auch kein saned.

Code: Alles auswählen

server:~# lsof -i :6566
Nichts lauscht an dem Port. Starte ich netcat und lasse es an dem Port lauschen, dann kommt es zu keiner Fehlermeldung.

Code: Alles auswählen

server:~# saned -d128 -a saned
[saned] main: starting debug mode (level 128)
[saned] read_config: searching for config file
[saned] read_config: done reading config
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.22 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
[saned] run_standalone: spawning Avahi process
[saned] run_standalone: waiting for control connection
[saned] saned_avahi: failed to create client: Daemon not running
[saned] handle_connection: processing client connection
[saned] check_host: detected an IPv4-mapped address
[saned] check_host: access by remote host: ::ffff:192.168.19.30
[saned] check_host: remote host is not IN_LOOPBACK nor IN6_LOOPBACK
[saned] check_host: local hostname: saned.mammut.alice19
[saned] check_host: local hostname(s) (from DNS): saned.mammut.alice19
[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: `'
[saned] check_host: config file line: `#scan-client.somedomain.firm'
[saned] check_host: config file line: `#192.168.0.1'
[saned] check_host: config file line: `#192.168.0.1/29'
[saned] check_host: config file line: `#[2001:7a8:185e::42:12]'
[saned] check_host: config file line: `#[2001:7a8:185e::42:12]/64'
[saned] check_host: config file line: `192.168.19.0/24'
[saned] check_host: subnet with base IP = 192.168.19.0, CIDR netmask = 24
[saned] check_host: access granted from IP address 192.168.19.30 (in subnet 192.168.19.0/24)
[saned] init: access granted
[saned] init: access granted to saned-user@::ffff:192.168.19.30
[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

Code: Alles auswählen

client:~$ scanimage -L
device `v4l:/dev/video2' is a Noname UVC Camera (046d:0825) virtual device
device `v4l:/dev/video1' is a Noname WinTV PVR 500 (unit #2) virtual device
device `v4l:/dev/video0' is a Noname WinTV PVR 500 (unit #1) virtual device
device `net:192.168.19.7:hp5590:libusb:002:002' is a HP 5590 Workgroup scanner

Code: Alles auswählen

server:~# lsof -i :6566
COMMAND  PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
saned   5098 root    3u  IPv6 5308519      0t0  TCP *:sane-port (LISTEN)
K.A wieso saned meldet, dass der Port schon belegt wäre.Was ich auch nicht verstehe ist: wieso beendet sich saned nach dem Request?

Ebenso gibt es nun auch einen User namens "saned", sowie eine Gruppe.

Code: Alles auswählen

server:~# id saned
uid=101(saned) gid=104(saned) Gruppen=104(saned),103(scanner)

syssi
Beiträge: 2951
Registriert: 24.12.2010 16:50:59
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: Rheinland

Re: saned over network. S: Wheezy, C: Squeeze

Beitrag von syssi » 13.04.2013 18:56:01

Hier laesst sich ein aehnlicher Fall finden, der einen aber auch nicht weiter bringt: http://lists.alioth.debian.org/pipermai ... 28242.html

Und hier ein Bug-Report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=642741

Offtopic: Mich stoert es haeufig, dass Webcams (v4l) als Scanner aufgefuehrt werden. Ein auskommentieren von "v4l" in der sane.d/dll.conf deaktiviert den v4l-Treiber.

rzs19
Beiträge: 13
Registriert: 27.09.2011 22:30:55

Re: saned over network. S: Wheezy, C: Squeeze

Beitrag von rzs19 » 13.04.2013 19:10:07

Danke für deine Bemühung. Ich probier mal x86, statt AMD64 um auch das ausschließen zu können.

syssi
Beiträge: 2951
Registriert: 24.12.2010 16:50:59
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: Rheinland

Re: saned over network. S: Wheezy, C: Squeeze

Beitrag von syssi » 13.04.2013 19:25:41

Ich wuerde eher am IPv6 an/aus herum schrauben.

rzs19
Beiträge: 13
Registriert: 27.09.2011 22:30:55

Re: saned over network. S: Wheezy, C: Squeeze

Beitrag von rzs19 » 13.04.2013 19:43:37

Also an der arch liegts mal nicht - wollte nur auf Nummer sicher gehen.

net.ipv6.conf.all.disable_ipv6 = 1 hab ich in der sysctl.conf eingetragen. Ein

Code: Alles auswählen

sysctl -p
wird's in dem Fall nicht bringen, oder? Eher ein neustart? Zumindest hat es nichts gebracht. Mal recherchieren wie man saned nur auf IPv4 lauschen läst. Einen reboot würde ich gerne vermeiden.

Antworten