You are not logged in.
Problem summary:
I have a home server that is configured with a static ip configured using netcfg and ifplugd. In the 'unit' section of sshd.service file I have 'After=sys-subsystem-net-devices-eno1.device' meant to let the service wait before the device is up. Ever since upgrading to systemd however at boot the sshd.service enters failed state. Only after manually issuing 'systemctl start sshd.service' the service will run and I can connect to it from another machine. I tried adding 'net-auto-wired.service' to the 'After' line but the result is the same.
/etc/conf.d/netcfg:
NETWORKS=(myethernet)
WIRED_INTERFACE="eno1"
/etc/network.d/myethernet:
CONNECTION="ethernet"
DESCRIPTION="A basic static ethernet connection using iproute"
INTERFACE="eno1"
IP="static"
ADDR="192.168.1.5"
GATEWAY="192.168.1.254"
DNS=("83.98.255.11")
/etc/systemd/system/sshd.service:
[Unit]
Description=OpenSSH Daemon
Wants=sshdgenkeys.service
#After=net-auto-wired.service sys-subsystem-net-devices-eno1.device
After=sys-subsystem-net-devices-eno1.device
[Service]
ExecStart=/usr/sbin/sshd -D
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=always
[Install]
WantedBy=multi-user.target
output of 'systemctl status sshd.service' after boot:
sshd.service - OpenSSH Daemon
Loaded: loaded (/etc/systemd/system/sshd.service; enabled)
Active: failed (Result: start-limit) since Sat 2013-03-09 22:09:38 CET; 3min 28s ago
Process: 405 ExecStart=/usr/sbin/sshd -D (code=exited, status=255)
Mar 09 22:09:38 arch-server systemd[1]: Unit sshd.service entered failed state
Mar 09 22:09:38 arch-server systemd[1]: sshd.service holdoff time over, scheduling restart.
Mar 09 22:09:38 arch-server systemd[1]: Stopping OpenSSH Daemon...
Mar 09 22:09:38 arch-server systemd[1]: Starting OpenSSH Daemon...
Mar 09 22:09:38 arch-server systemd[1]: sshd.service start request repeated too quickly, refusing to start.
Mar 09 22:09:38 arch-server systemd[1]: Failed to start OpenSSH Daemon.
Mar 09 22:09:38 arch-server systemd[1]: Unit sshd.service entered failed state
output of 'journalctl -b | grep sshd'
Mar 09 22:09:36 arch-server sshd[342]: Set /proc/self/oom_score_adj from 0 to -1000
Mar 09 22:09:36 arch-server sshd[342]: error: Bind to port 22 on 192.168.1.5 failed: Cannot assign requested address.
Mar 09 22:09:36 arch-server sshd[342]: fatal: Cannot bind any address.
Mar 09 22:09:36 arch-server systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a
Mar 09 22:09:36 arch-server systemd[1]: Unit sshd.service entered failed state
Mar 09 22:09:36 arch-server systemd[1]: sshd.service holdoff time over, scheduling restart.
Mar 09 22:09:36 arch-server sshd[384]: Set /proc/self/oom_score_adj from 0 to -1000
Mar 09 22:09:36 arch-server sshd[384]: error: Bind to port 22 on 192.168.1.5 failed: Cannot assign requested address.
Mar 09 22:09:36 arch-server sshd[384]: fatal: Cannot bind any address.
Mar 09 22:09:36 arch-server systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a
Mar 09 22:09:36 arch-server systemd[1]: Unit sshd.service entered failed state
Mar 09 22:09:36 arch-server systemd[1]: sshd.service holdoff time over, scheduling restart.
Mar 09 22:09:36 arch-server systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a
Mar 09 22:09:36 arch-server sshd[390]: Set /proc/self/oom_score_adj from 0 to -1000
Mar 09 22:09:36 arch-server sshd[390]: error: Bind to port 22 on 192.168.1.5 failed: Cannot assign requested address.
Mar 09 22:09:36 arch-server sshd[390]: fatal: Cannot bind any address.
Mar 09 22:09:37 arch-server systemd[1]: Unit sshd.service entered failed state
Mar 09 22:09:37 arch-server systemd[1]: sshd.service holdoff time over, scheduling restart.
Mar 09 22:09:37 arch-server sshd[393]: Set /proc/self/oom_score_adj from 0 to -1000
Mar 09 22:09:37 arch-server sshd[393]: error: Bind to port 22 on 192.168.1.5 failed: Cannot assign requested address.
Mar 09 22:09:37 arch-server sshd[393]: fatal: Cannot bind any address.
Mar 09 22:09:37 arch-server systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a
Mar 09 22:09:37 arch-server systemd[1]: Unit sshd.service entered failed state
Mar 09 22:09:37 arch-server systemd[1]: sshd.service holdoff time over, scheduling restart.
Mar 09 22:09:37 arch-server sshd[395]: Set /proc/self/oom_score_adj from 0 to -1000
Mar 09 22:09:37 arch-server sshd[395]: error: Bind to port 22 on 192.168.1.5 failed: Cannot assign requested address.
Mar 09 22:09:37 arch-server sshd[395]: fatal: Cannot bind any address.
Mar 09 22:09:37 arch-server systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a
Mar 09 22:09:37 arch-server systemd[1]: Unit sshd.service entered failed state
Mar 09 22:09:37 arch-server systemd[1]: sshd.service holdoff time over, scheduling restart.
Mar 09 22:09:37 arch-server sshd[405]: Set /proc/self/oom_score_adj from 0 to -1000
Mar 09 22:09:37 arch-server sshd[405]: error: Bind to port 22 on 192.168.1.5 failed: Cannot assign requested address.
Mar 09 22:09:37 arch-server sshd[405]: fatal: Cannot bind any address.
Mar 09 22:09:37 arch-server systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a
Mar 09 22:09:38 arch-server systemd[1]: Unit sshd.service entered failed state
Mar 09 22:09:38 arch-server systemd[1]: sshd.service holdoff time over, scheduling restart.
Mar 09 22:09:38 arch-server systemd[1]: sshd.service start request repeated too quickly, refusing to start.
Mar 09 22:09:38 arch-server systemd[1]: Unit sshd.service entered failed state
Mar 09 22:13:19 arch-server sshd[597]: Set /proc/self/oom_score_adj from 0 to -1000
Mar 09 22:13:19 arch-server sshd[597]: Server listening on 192.168.1.5 port 22.
Mar 09 22:13:58 arch-server sshd[603]: Set /proc/self/oom_score_adj to 0
output of 'ip link':
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 (...) prefixlen 64 scopeid 0x20<link>
ether (...) txqueuelen 1000 (Ethernet)
RX packets 2399 bytes 176947 (172.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 846 bytes 112345 (109.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 45 base 0x4000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436
(...)
output of 'systemctl' after issuing 'systemctl start sshd.service' :
UNIT LOAD ACTIVE SUB DESCRIPTION
proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File System Automount Point
sys-devices-pci0000:00-0000:00:1b.0-sound-card0.device loaded active plugged /sys/devices/pci0000:00/0000:00:1b.0/sound/card0
sys-devices-pci0000:00-0000:00:1c.0-0000:01:00.0-net-eno1.device loaded active plugged /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/eno1
sys-devices-pci0000:00-0000:00:1c.1-0000:02:00.0-net-wlp2s0.device loaded active plugged /sys/devices/pci0000:00/0000:00:1c.1/0000:02:00.0/net/wlp2s0
sys-devices-pci0000:00-0000:...d5:1.0-host6-target6:0:0-6:0:0:0-block-sdc-sdc1.device loaded active plugged U3_Cruzer_Micro
sys-devices-pci0000:00-0000:...d5:1.0-host6-target6:0:0-6:0:0:0-block-sdc-sdc2.device loaded active plugged U3_Cruzer_Micro
sys-devices-pci0000:00-0000:...-1\x2d5:1.0-host6-target6:0:0-6:0:0:0-block-sdc.device loaded active plugged U3_Cruzer_Micro
sys-devices-pci0000:00-0000:00:1f.2-host2-target2:0:0-2:0:0:0-block-sda-sda1.device loaded active plugged FUJITSU_MJA2320BH_G2
sys-devices-pci0000:00-0000:00:1f.2-host2-target2:0:0-2:0:0:0-block-sda-sda2.device loaded active plugged FUJITSU_MJA2320BH_G2
sys-devices-pci0000:00-0000:00:1f.2-host2-target2:0:0-2:0:0:0-block-sda-sda3.device loaded active plugged FUJITSU_MJA2320BH_G2
sys-devices-pci0000:00-0000:00:1f.2-host2-target2:0:0-2:0:0:0-block-sda.device loaded active plugged FUJITSU_MJA2320BH_G2
sys-devices-pci0000:00-0000:00:1f.2-host4-target4:0:0-4:0:0:0-block-sdb-sdb1.device loaded active plugged FUJITSU_MJA2320BH_G2
sys-devices-pci0000:00-0000:00:1f.2-host4-target4:0:0-4:0:0:0-block-sdb.device loaded active plugged FUJITSU_MJA2320BH_G2
sys-devices-platform-serial8250-tty-ttyS2.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS2
sys-devices-platform-serial8250-tty-ttyS3.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS3
sys-devices-pnp0-00:03-tty-ttyS0.device loaded active plugged /sys/devices/pnp0/00:03/tty/ttyS0
sys-devices-pnp0-00:04-tty-ttyS1.device loaded active plugged /sys/devices/pnp0/00:04/tty/ttyS1
sys-devices-virtual-block-dm\x2d0.device loaded active plugged /sys/devices/virtual/block/dm-0
sys-devices-virtual-block-dm\x2d1.device loaded active plugged /sys/devices/virtual/block/dm-1
sys-devices-virtual-block-dm\x2d2.device loaded active plugged /sys/devices/virtual/block/dm-2
sys-subsystem-net-devices-eno1.device loaded active plugged /sys/subsystem/net/devices/eno1
sys-subsystem-net-devices-wlp2s0.device loaded active plugged /sys/subsystem/net/devices/wlp2s0
-.mount loaded active mounted /
dev-hugepages.mount loaded active mounted Huge Pages File System
dev-mqueue.mount loaded active mounted POSIX Message Queue File System
home.mount loaded active mounted /home
media-usbhd\x2dsdc1.mount loaded active mounted /media/usbhd-sdc1
media-usbhd\x2dsdc2.mount loaded active mounted /media/usbhd-sdc2
mnt-backup.mount loaded active mounted /mnt/backup
mnt-data.mount loaded active mounted /mnt/data
srv.mount loaded active mounted /srv
sys-kernel-debug.mount loaded active mounted Debug File System
tmp.mount loaded active mounted /tmp
var.mount loaded active mounted /var
systemd-ask-password-console.path loaded active waiting Dispatch Password Requests to Console Directory Watch
systemd-ask-password-wall.path loaded active waiting Forward Password Requests to Wall Directory Watch
dbus.service loaded active running D-Bus System Message Bus
dcron.service loaded active running Periodic Command Scheduler
getty@tty1.service loaded active running Getty on tty1
httpd.service loaded active running Apache Web Server
iptables.service loaded active exited Packet Filtering Framework
mysqld.service loaded active running MySQL database server
net-auto-wired.service loaded active running Provides automatic netcfg wired connection
ntpd.service loaded active running Network Time Service
rc-local.service loaded active exited /etc/rc.local Compatibility
rtorrent.service loaded active running rTorrent Service
sshd.service loaded active running OpenSSH Daemon
sshguard.service loaded active running Block hacking attempts
systemd-cryptsetup@luks_backup.service loaded active exited Cryptography Setup for luks_backup
systemd-cryptsetup@luks_data.service loaded active exited Cryptography Setup for luks_data
systemd-cryptsetup@luks_swap.service loaded active exited Cryptography Setup for luks_swap
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running Login Service
systemd-modules-load.service loaded active exited Load Kernel Modules
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
systemd-sysctl.service loaded active exited Apply Kernel Variables
systemd-tmpfiles-setup.service loaded active exited Recreate Volatile Files and Directories
systemd-udev-trigger.service loaded active exited udev Coldplug all Devices
systemd-udevd.service loaded active running udev Kernel Device Manager
systemd-user-sessions.service loaded active exited Permit User Sessions
systemd-vconsole-setup.service loaded active exited Setup Virtual Console
dbus.socket loaded active running D-Bus System Message Bus Socket
dmeventd.socket loaded active listening Device-mapper event daemon FIFOs
lvmetad.socket loaded active listening LVM2 metadata daemon socket
systemd-initctl.socket loaded active listening /dev/initctl Compatibility Named Pipe
systemd-journald.socket loaded active running Journal Socket
Last edited by rwd (2013-03-10 08:32:59)
Offline
I don't use netcfg and I don't have a static ip on my Arch box but I believe this is a known issue. Take a look at the bug reports for netcfg and/or search the forums. This issue (or very similar e.g. network failures as opposed to specific service failures) have definitely been discussed several times recently.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Does enabling the socket work? Sshd with systemd has socket activation, which is awesome.
Offline
Does enabling the socket work? Sshd with systemd has socket activation, which is awesome.
Nice, this solves it indeed. thanks!
For anyone with the same problem it was just a matter of:
# systemctl disable sshd.service
# systemctl enable sshd.socket
see https://wiki.archlinux.org/index.php/Se … shd_daemon
Last edited by rwd (2013-03-10 09:08:43)
Offline
thanks a lot - this solved for me too
Offline
I think netctl solves this problem
bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U
Offline