systemctl 停止理智

systemctl 停止理智

我正在运行 Ubuntu 19.10,并且我已经成功地使用以下命令在我的 LAN 中配置了 Epson 网络扫描仪理智的公用事业。尽管扫描仪工作正常,但命令sudo systemctl status saned显示以下内容

    ● 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

为了找出 sane 出了什么问题,我运行了sudo netstat -tlnp以下命令:

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     

我不明白为什么要处理在里面正在使用端口 6566,该端口应该被 sane 服务器占用。重点是:命令systemctl -all list-sockets显示端口 6566 已被使用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                    [email protected]: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

当然,如果我停下来saned.socket然后开始萨尼德,各部分的作用相反,所以saned.socket下降并且萨尼德往上。我不是 Unix 系统的专家,所以我想了解 和 之间的区别saned.socketsaned并找到一种方法让它们正常工作

答案1

这里同样的问题,已经有一段时间了。有时它可以工作,然后在下次扫描期间停止并显示错误消息

[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)) 

已经尝试了很多事情:

  • 通过 systemctl 禁用、启用停止、启动、重新启动;
  • 通过 apt 清除、删除、安装、重新安装;
  • 通过 dpkg-reconfigure 重新配置;
  • 下载、编译和安装最新的后端。

systemctl 停止理智

# 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)) 

在以 root 身份执行这些命令之间,我尝试在另一个终端中以普通用户身份使用 scanimage 进行扫描。

现在等待一些进程完成然后重新启动。

答案2

我通过删除让我的再次工作一切与 sane-airscan 相关。 apt purge sane-airscansystemctl stop saned.service& systemctl stop saned.socket,然后删除:

  • /etc/defaults/sane
  • /etc/init.d/saned
  • /lib/systemd/system/saned.socket
  • /lib/systemd/system/saned.service

重新启动,然后我通过以下方式安装它:

wget https://download.opensuse.org/repositories/home:/pzz/xUbuntu_18.04/amd64/sane-airscan_0.99.27-1+89.1_amd64.deb
dpkg -i sane-airscan_0.99.27-1+89.1_amd64.deb
root@laptop:~# export SANE_DEBUG_DLL=255 && scanimage -L 
[sanei_debug] Setting debug level of dll to 255.
[dll] sane_init: SANE dll backend version 1.0.13 from sane-backends 1.0.27
[dll] sane_init/read_dlld: attempting to open directory `./dll.d'
[dll] sane_init/read_dlld: attempting to open directory `/etc/sane.d/dll.d'
[dll] sane_init/read_dlld: using config directory `/etc/sane.d/dll.d'
[dll] sane_init/read_dlld: considering /etc/sane.d/dll.d/airscan
[dll] sane_init/read_config: reading dll.d/airscan
[dll] add_backend: adding backend `airscan'
[dll] sane_init/read_dlld: considering /etc/sane.d/dll.d/hplip
[dll] sane_init/read_config: reading dll.d/hplip
[dll] add_backend: adding backend `hpaio'
[dll] sane_init/read_dlld: done.
[dll] sane_init/read_config: reading dll.conf
[dll] add_backend: adding backend `net'
[dll] add_backend: adding backend `abaton'
[dll] add_backend: adding backend `agfafocus'
[dll] add_backend: adding backend `apple'
[dll] add_backend: adding backend `avision'
[dll] add_backend: adding backend `artec'
[dll] add_backend: adding backend `artec_eplus48u'
[dll] add_backend: adding backend `as6e'
[dll] add_backend: adding backend `bh'
[dll] add_backend: adding backend `canon'
[dll] add_backend: adding backend `canon630u'
[dll] add_backend: adding backend `canon_dr'
[dll] add_backend: adding backend `cardscan'
[dll] add_backend: adding backend `coolscan'
[dll] add_backend: adding backend `coolscan3'
[dll] add_backend: adding backend `dell1600n_net'
[dll] add_backend: adding backend `dmc'
[dll] add_backend: adding backend `epjitsu'
[dll] add_backend: adding backend `epson2'
[dll] add_backend: adding backend `epsonds'
[dll] add_backend: adding backend `fujitsu'
[dll] add_backend: adding backend `genesys'
[dll] add_backend: adding backend `gt68xx'
[dll] add_backend: adding backend `hp'
[dll] add_backend: adding backend `hp3900'
[dll] add_backend: adding backend `hpsj5s'
[dll] add_backend: adding backend `hp3500'
[dll] add_backend: adding backend `hp4200'
[dll] add_backend: adding backend `hp5400'
[dll] add_backend: adding backend `hp5590'
[dll] add_backend: adding backend `hpljm1005'
[dll] add_backend: adding backend `hs2p'
[dll] add_backend: adding backend `ibm'
[dll] add_backend: adding backend `kodak'
[dll] add_backend: adding backend `kodakaio'
[dll] add_backend: adding backend `kvs1025'
[dll] add_backend: adding backend `kvs20xx'
[dll] add_backend: adding backend `leo'
[dll] add_backend: adding backend `lexmark'
[dll] add_backend: adding backend `ma1509'
[dll] add_backend: adding backend `magicolor'
[dll] add_backend: adding backend `matsushita'
[dll] add_backend: adding backend `microtek'
[dll] add_backend: adding backend `microtek2'
[dll] add_backend: adding backend `mustek'
[dll] add_backend: adding backend `mustek_usb'
[dll] add_backend: adding backend `mustek_usb2'
[dll] add_backend: adding backend `nec'
[dll] add_backend: adding backend `niash'
[dll] add_backend: adding backend `pie'
[dll] add_backend: adding backend `pint'
[dll] add_backend: adding backend `pixma'
[dll] add_backend: adding backend `plustek'
[dll] add_backend: adding backend `qcam'
[dll] add_backend: adding backend `ricoh'
[dll] add_backend: adding backend `rts8891'
[dll] add_backend: adding backend `s9036'
[dll] add_backend: adding backend `sceptre'
[dll] add_backend: adding backend `sharp'
[dll] add_backend: adding backend `sm3600'
[dll] add_backend: adding backend `sm3840'
[dll] add_backend: adding backend `snapscan'
[dll] add_backend: adding backend `sp15c'
[dll] add_backend: adding backend `tamarack'
[dll] add_backend: adding backend `teco1'
[dll] add_backend: adding backend `teco2'
[dll] add_backend: adding backend `teco3'
[dll] add_backend: adding backend `u12'
[dll] add_backend: adding backend `umax'
[dll] add_backend: adding backend `umax1220u'
[dll] add_backend: adding backend `v4l'
[dll] add_backend: adding backend `xerox_mfp'
[dll] sane_get_devices
[dll] load: searching backend `xerox_mfp' in `/usr/lib/x86_64-linux-gnu/sane:/usr/lib/sane:/usr/lib64/sane'
[dll] load: trying to load `/usr/lib/x86_64-linux-gnu/sane/libsane-xerox_mfp.so.1'
[dll] load: dlopen()ing `/usr/lib/x86_64-linux-gnu/sane/libsane-xerox_mfp.so.1'
...
[dll] load: dlopen()ing `/usr/lib/x86_64-linux-gnu/sane/libsane-agfafocus.so.1'
[dll] init: initializing backend `agfafocus'
[dll] init: backend `agfafocus' is version 1.0.0
[dll] load: searching backend `abaton' in `/usr/lib/x86_64-linux-gnu/sane:/usr/lib/sane:/usr/lib64/sane'
[dll] load: trying to load `/usr/lib/x86_64-linux-gnu/sane/libsane-abaton.so.1'
[dll] load: dlopen()ing `/usr/lib/x86_64-linux-gnu/sane/libsane-abaton.so.1'
[dll] init: initializing backend `abaton'
[dll] init: backend `abaton' is version 1.0.0
[dll] load: searching backend `net' in `/usr/lib/x86_64-linux-gnu/sane:/usr/lib/sane:/usr/lib64/sane'
[dll] load: trying to load `/usr/lib/x86_64-linux-gnu/sane/libsane-net.so.1'
[dll] load: dlopen()ing `/usr/lib/x86_64-linux-gnu/sane/libsane-net.so.1'
[dll] init: initializing backend `net'
[dll] init: backend `net' is version 1.0.27
[dll] load: searching backend `hpaio' in `/usr/lib/x86_64-linux-gnu/sane:/usr/lib/sane:/usr/lib64/sane'
[dll] load: trying to load `/usr/lib/x86_64-linux-gnu/sane/libsane-hpaio.so.1'
[dll] load: dlopen()ing `/usr/lib/x86_64-linux-gnu/sane/libsane-hpaio.so.1'
[dll] init: initializing backend `hpaio'
[dll] init: backend `hpaio' is version 1.0.0
[dll] load: searching backend `airscan' in `/usr/lib/x86_64-linux-gnu/sane:/usr/lib/sane:/usr/lib64/sane'
[dll] load: trying to load `/usr/lib/x86_64-linux-gnu/sane/libsane-airscan.so.1'
[dll] load: dlopen()ing `/usr/lib/x86_64-linux-gnu/sane/libsane-airscan.so.1'
[dll] init: initializing backend `airscan'
[dll] init: backend `airscan' is version 1.0.0
[dll] sane_get_devices: found 1 devices
device `airscan:w0:Dell C1765nf Color MFP' is a WSD Dell C1765nf Color MFP ip=192.168.2.16
[dll] sane_exit: exiting
[dll] sane_exit: calling backend `xerox_mfp's exit function
[dll] sane_exit: calling backend `umax1220u's exit function
[dll] sane_exit: calling backend `umax's exit function
[dll] sane_exit: calling backend `u12's exit function
[dll] sane_exit: calling backend `teco3's exit function
[dll] sane_exit: calling backend `teco2's exit function
[dll] sane_exit: calling backend `teco1's exit function
[dll] sane_exit: calling backend `tamarack's exit function
[dll] sane_exit: calling backend `sp15c's exit function
[dll] sane_exit: calling backend `snapscan's exit function
[dll] sane_exit: calling backend `sm3840's exit function
[dll] sane_exit: calling backend `sm3600's exit function
[dll] sane_exit: calling backend `sharp's exit function
[dll] sane_exit: calling backend `sceptre's exit function
[dll] sane_exit: calling backend `s9036's exit function
[dll] sane_exit: calling backend `rts8891's exit function
[dll] sane_exit: calling backend `ricoh's exit function
[dll] sane_exit: calling backend `qcam's exit function
[dll] sane_exit: calling backend `plustek's exit function
[dll] sane_exit: calling backend `pixma's exit function
[dll] sane_exit: calling backend `pie's exit function
[dll] sane_exit: calling backend `niash's exit function
[dll] sane_exit: calling backend `nec's exit function
[dll] sane_exit: calling backend `mustek_usb2's exit function
[dll] sane_exit: calling backend `mustek_usb's exit function
[dll] sane_exit: calling backend `mustek's exit function
[dll] sane_exit: calling backend `microtek2's exit function
[dll] sane_exit: calling backend `microtek's exit function
[dll] sane_exit: calling backend `matsushita's exit function
[dll] sane_exit: calling backend `magicolor's exit function
[dll] sane_exit: calling backend `ma1509's exit function
[dll] sane_exit: calling backend `lexmark's exit function
[dll] sane_exit: calling backend `leo's exit function
[dll] sane_exit: calling backend `kvs20xx's exit function
[dll] sane_exit: calling backend `kvs1025's exit function
[dll] sane_exit: calling backend `kodakaio's exit function
[dll] sane_exit: calling backend `kodak's exit function
[dll] sane_exit: calling backend `ibm's exit function
[dll] sane_exit: calling backend `hs2p's exit function
[dll] sane_exit: calling backend `hpljm1005's exit function
[dll] sane_exit: calling backend `hp5590's exit function
[dll] sane_exit: calling backend `hp5400's exit function
[dll] sane_exit: calling backend `hp4200's exit function
[dll] sane_exit: calling backend `hp3500's exit function
[dll] sane_exit: calling backend `hpsj5s's exit function
[dll] sane_exit: calling backend `hp3900's exit function
[dll] sane_exit: calling backend `hp's exit function
[dll] sane_exit: calling backend `gt68xx's exit function
[dll] sane_exit: calling backend `genesys's exit function
[dll] sane_exit: calling backend `fujitsu's exit function
[dll] sane_exit: calling backend `epsonds's exit function
[dll] sane_exit: calling backend `epson2's exit function
[dll] sane_exit: calling backend `epjitsu's exit function
[dll] sane_exit: calling backend `dmc's exit function
[dll] sane_exit: calling backend `dell1600n_net's exit function
[dll] sane_exit: calling backend `coolscan3's exit function
[dll] sane_exit: calling backend `coolscan's exit function
[dll] sane_exit: calling backend `cardscan's exit function
[dll] sane_exit: calling backend `canon_dr's exit function
[dll] sane_exit: calling backend `canon630u's exit function
[dll] sane_exit: calling backend `canon's exit function
[dll] sane_exit: calling backend `bh's exit function
[dll] sane_exit: calling backend `artec_eplus48u's exit function
[dll] sane_exit: calling backend `artec's exit function
[dll] sane_exit: calling backend `avision's exit function
[dll] sane_exit: calling backend `apple's exit function
[dll] sane_exit: calling backend `agfafocus's exit function
[dll] sane_exit: calling backend `abaton's exit function
[dll] sane_exit: calling backend `net's exit function
[dll] sane_exit: calling backend `hpaio's exit function
[dll] sane_exit: calling backend `airscan's exit function
[dll] sane_exit: finished

如您所见,我的戴尔多功能一体机已找到: device airscan:w0:Dell C1765nf Color MFP' is a WSD Dell C1765nf Color MFP ip=192.168.2.16

相关内容