0

I'm running Ubuntu 19.10 and I've successfully managed to configure an Epson network scanner in my LAN using sane utility. Although the scanner works fine, command sudo systemctl status saned shows the following

    ● saned.service - LSB: SANE network scanner server
   Loaded: loaded (/etc/init.d/saned; generated)
   Active: failed (Result: exit-code) since Wed 2020-03-04 09:47:47 CET; 1min 5s
     Docs: man:systemd-sysv-generator(8)
  Process: 1166 ExecStart=/etc/init.d/saned start (code=exited, status=1/FAILURE

Mar 04 09:47:47 david-PC saned[1166]:  * Starting SANE network scanner server sa
Mar 04 09:47:47 david-PC saned[1180]: saned (AF-indep+IPv6) from sane-backends 1
Mar 04 09:47:47 david-PC saned[1180]: do_bindings: [1] bind failed: Address alre
Mar 04 09:47:47 david-PC saned[1180]: do_bindings: [0] bind failed: Address alre
Mar 04 09:47:47 david-PC saned[1180]: do_bindings: couldn't bind an address. Exi
Mar 04 09:47:47 david-PC saned[1180]: FATAL ERROR; bailing out, waiting for chil
Mar 04 09:47:47 david-PC saned[1180]: bail_out: all children exited
Mar 04 09:47:47 david-PC systemd[1]: saned.service: Control process exited, code
Mar 04 09:47:47 david-PC systemd[1]: saned.service: Failed with result 'exit-cod
Mar 04 09:47:47 david-PC systemd[1]: Failed to start LSB: SANE network scanner s

Trying to figure out what's going wrong with sane, I run sudo netstat -tlnp which shows the following:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:1579            0.0.0.0:*               LISTEN      1234/sshd           
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      1009/systemd-resolv 
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1067/cupsd          
tcp        0      0 0.0.0.0:35587           0.0.0.0:*               LISTEN      1080/ecbd           
tcp6       0      0 :::6566                 :::*                    LISTEN      1/init              
tcp6       0      0 :::1579                 :::*                    LISTEN      1234/sshd           
tcp6       0      0 ::1:631                 :::*                    LISTEN      1067/cupsd     

I don't understand why process init is using port 6566, which should be occupied by sane server. Here is the point: command systemctl -all list-sockets shows that port 6566 is used by saned.socket

LISTEN                       UNIT                            ACTIVATES
/run/acpid.socket            acpid.socket                    acpid.service
/run/apport.socket           apport-forward.socket          
/run/avahi-daemon/socket     avahi-daemon.socket             avahi-daemon.service
/run/cups/cups.sock          cups.socket                     cups.service
/run/dbus/system_bus_socket  dbus.socket                     dbus.service
/run/initctl                 systemd-initctl.socket          systemd-initctl.service
/run/snapd-snap.socket       snapd.socket                    snapd.service
/run/snapd.socket            snapd.socket                    snapd.service
/run/systemd/fsck.progress   systemd-fsckd.socket            systemd-fsckd.service
/run/systemd/journal/dev-log systemd-journald-dev-log.socket systemd-journald.service
/run/systemd/journal/socket  systemd-journald.socket         systemd-journald.service
/run/systemd/journal/stdout  systemd-journald.socket         systemd-journald.service
/run/systemd/journal/syslog  syslog.socket                   rsyslog.service
/run/udev/control            systemd-udevd-control.socket    systemd-udevd.service
/run/uuidd/request           uuidd.socket                    uuidd.service
[::]:6566                    saned.socket                    saned@0-192.168.1.66:6566-192.168.1.66:36282
audit 1                      systemd-journald-audit.socket   systemd-journald.service
kobject-uevent 1             systemd-udevd-kernel.socket     systemd-udevd.service

Of course, if I stop saned.socket and then start saned, the parts do the opposite, so saned.socket goes down and saned goes up. I'm not an expert of Unix systems, so I want to understand which is the difference between saned.socket and saned and find out a way to get both them working properly

2

Same issue here, since quite some time. Sometimes it works, then it stops during the next scan with error message

[bjnp] bjnp_open_tcp: ERROR - Can not connect to scanner: Connection refused
scanimage: sane_read: Invalid argument
# ss  -tulpn | grep :6566
tcp     LISTEN   0        128                    *:6566                 *:*      users:(("systemd",pid=1,fd=160)) 

Many things have been tried:

  • disabling,enabling stopping, starting, restarting via systemctl;
  • purge,remove, installing, reinstalling via apt;
  • reconfigure via dpkg-reconfigure;
  • download, compile and install of newest backends.

systemctl stop sane

# saned -d -a saned
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.27 starting up
[saned] do_bindings: [0] bind failed: Address already in use
[saned] Now daemonized

# systemctl disable saned.socket 
Removed /etc/systemd/system/sockets.target.wants/saned.socket.
# saned -d -a saned
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.27 starting up
[saned] do_bindings: [1] bind failed: Address already in use
[saned] do_bindings: [0] bind failed: Address already in use
[saned] do_bindings: couldn't bind an address. Exiting.
[saned] FATAL ERROR; bailing out, waiting for children...
[saned] bail_out: all children exited
# ps ax | grep inet
23794 pts/7    S+     0:00 grep inet
32284 ?        Ss     0:01 /usr/sbin/inetd
# kill 32284
# ps ax | grep inet
23961 pts/7    S+     0:00 grep inet
# saned -d -a saned
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.27 starting up
[saned] do_bindings: [1] bind failed: Address already in use
[saned] do_bindings: [0] bind failed: Address already in use
[saned] do_bindings: couldn't bind an address. Exiting.
[saned] FATAL ERROR; bailing out, waiting for children...
[saned] bail_out: all children exited
# systemctl enable saned
saned.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable saned
# systemctl disable saned
saned.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable saned
# systemctl enable saned.socket 
Created symlink /etc/systemd/system/sockets.target.wants/saned.socket → /etc/systemd/system/saned.socket.
# systemctl start  saned.socket 
Job for saned.socket failed.
See "systemctl status saned.socket" and "journalctl -xe" for details.
# systemctl status saned.socket
● saned.socket - saned incoming socket
   Loaded: loaded (/etc/systemd/system/saned.socket; enabled; vendor preset: enabled)
   Active: failed (Result: resources)
   Listen: [::]:6566 (Stream)
 Accepted: 0; Connected: 0;

Mai 12 09:29:41 monster systemd[1]: saned.socket: Failed to receive listening socket ([::]:6566): Input/output error
Mai 12 09:29:41 monster systemd[1]: saned.socket: Failed to listen on sockets: Input/output error
Mai 12 09:29:41 monster systemd[1]: saned.socket: Failed with result 'resources'.
Mai 12 09:29:41 monster systemd[1]: Failed to listen on saned incoming socket.

# ss  -tulpn | grep :6566
tcp     LISTEN   0        1                      *:6566                 *:*      users:(("saned",pid=22068,fd=3)) 

In between these commands as root, I tried to scan with scanimage as normal user in another terminal.

Now waiting for some processes to finish and then to reboot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.