With some help from a contributor (Lukasa) I was able to adjust the example to work on a daemon.
The problem was that the example binds itself to the stdout (writing the response of the ssh command to it). As the stdout is bound to a file in a daemon and the bootstrap includes a check that the output is not a file, an error would occur.
For anyone else experiencing this issue in the future, I've updated the reproduction to include the solution: https://github.com/eliaSchenker/nio-ssh-daemon-issue/tree/main
Topic:
App & System Services
SubTopic:
Networking
Tags: