我在启动 dovecot 服务器时遇到了一些问题。我收到以下错误:
Failed to start Dovecot :
Error: service(imap-login): listen(*, 143) failed: Address already in use
Error: service(imap-login): listen(::, 143) failed: Address already in use
Error: service(imap-login): listen(*, 993) failed: Address already in use
Error: service(imap-login): listen(::, 993) failed: Address already in use
Fatal: Failed to start listeners
因此我netstat
针对 993 端口运行命令:
# netstat -lnp | grep 993
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 1/init
tcp6 0 0 :::993 :::* LISTEN 1/init
我该怎么做才能停止 init 进程监听这些端口?
编辑
命令结果systemctl -all list-sockets
:
# systemctl -all list-sockets
LISTEN UNIT ACTIVATES
/run/acpid.socket acpid.socket acpid.service
/run/dmeventd-client dm-event.socket dm-event.service
/run/dmeventd-server dm-event.socket dm-event.service
/run/lvm/lvmetad.socket lvm2-lvmetad.socket lvm2-lvmetad.service
/run/systemd/initctl/fifo systemd-initctl.socket systemd-initctl.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/systemd/shutdownd systemd-shutdownd.socket systemd-shutdownd.service
/run/udev/control systemd-udevd-control.socket systemd-udevd.service
/var/run/clamav/clamd.ctl clamav-daemon.socket clamav-daemon.service
/var/run/dbus/system_bus_socket dbus.socket dbus.service
0.0.0.0:143 dovecot.socket dovecot.service
0.0.0.0:993 dovecot.socket dovecot.service
[::]:143 dovecot.socket dovecot.service
[::]:993 dovecot.socket dovecot.service
kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
18 sockets listed.
答案1
尝试停止套接字并重新启动dovecot
。
systemctl stop dovecot.socket
systemctl start dovecot.service
看起来套接字在启动dovecot
之前就已经启动了dovecot
。