New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/sshd: added missing systemd controls #34331
Conversation
cc me as openssh maintainer |
My setup is the following :
In my setup, X.X.X.X is an ip address assigned either on a bridge or a physical interface. I agree with your comments on socket activation. Also when I remove the What first struck me as strange is the fact that the
which is why I added the
so it seems Also, from a theoretical standpoint, we could consider that sshd is useless without network, and so the If we look at the systemd unit for sshd in ArchLinux, they only included |
I've been testing networkd in the last few weeks and have a problem with this change and the way networkd is currently integrated into NixOS. If general DHCP ( I think we should rather fix our networkd integration than adding this change prematurely and thus possibly break sshd for regular networkd users. EDIT: This is also the case if networkd is not used. If there is no DHCP available even though some interfaces are statically configured => no |
@fpletz, it's true the the If I understand the manual correctly, the
I propose 3 solutions (assuming the above assumption is correct):
In the end, I think we need to implement at least one of these options, because, in the current setup, the sshd will fail to start if address binding is configured (which caused me quite a bit of trouble when I upgraded to 17.09 and had to revert to the serial console). What do you think is the best course of action ? |
@GrahamcOfBorg test openssh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success on aarch64-linux (full log)
Partial log (click to expand)
2 out of 2 tests succeeded
server_lazy# [ 36.931141] systemd[981]: Reached target Shutdown.
test script finished in 38.92s
cleaning up
killing client (pid 627)
killing server_lazy (pid 638)
killing server (pid 651)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/z4b81hf2svad6h4i5fkyqh2mnxzbhhz9-vm-test-run-openssh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure on x86_64-linux (full log)
Partial log (click to expand)
cannot build derivation ‘/nix/store/xrga9zij6k202vc0w7c05r5m0ga83y2l-closure-info.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/0xl99baq75h8qia3g3qbcnqfsa9xk9ns-run-nixos-vm.drv’: 2 dependencies couldn't be built
cannot build derivation ‘/nix/store/2kndnc9qhblkxlamnr82c66p8nq3msrk-run-nixos-vm.drv’: 2 dependencies couldn't be built
cannot build derivation ‘/nix/store/9yapbrbrpir6wi9m2ixxwjmfjksvx7bm-run-nixos-vm.drv’: 2 dependencies couldn't be built
cannot build derivation ‘/nix/store/mbs84zwv9v96ibfra526jfqqvy2d25wa-nixos-vm.drv’: 2 dependencies couldn't be built
cannot build derivation ‘/nix/store/nia8rwa6gajgizf6d0z51sj2840jn7qk-nixos-vm.drv’: 2 dependencies couldn't be built
cannot build derivation ‘/nix/store/rgbgq7k1j0kg2f177gm5hsznzmgc24x0-nixos-vm.drv’: 2 dependencies couldn't be built
cannot build derivation ‘/nix/store/7jqcizy5vjnfvd2jfyx9qnlmgr6arq1h-nixos-test-driver-openssh.drv’: 3 dependencies couldn't be built
cannot build derivation ‘/nix/store/2c7rsnr5djw8bw5wgyg6yrm15bpl5xx0-vm-test-run-openssh.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/2c7rsnr5djw8bw5wgyg6yrm15bpl5xx0-vm-test-run-openssh.drv’ failed
I could not access full logs on the x86_64-linux but I assume since the aarch is working (and this change is not a program change) the problem is elsewhere ? |
Added after= and requires= systemd order options. Without the two options, sshd fails to start if ip binding is configured in ssh_config (because ip address is not defined when sshd starts) This fixes issue NixOS#30903 for sshd service.
ef86237
to
723b5f8
Compare
I will close this, since I think using |
Added after= and requires= systemd order options.
Without the two options, sshd fails to start if
ip binding is configured in ssh_config (because
ip address is not defined when sshd starts)
This fixes issue #30903 for sshd service.
Motivation for this change
Without this change, sshd fails to start when ip binding is configured in sshd.
Things done
Tested in my personal nixos setup (sshd wouldn't start without this).
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)