Recent Upstart has these new fancy systemd-like features of starting jobs on incoming connection via socket-bridge. I'd like to start my sshd upon first connection to port 22.
I now have:
start on socket PROTO=inet PORT=22 in my ssh.conf and I have upstart-socket-bridge and upstart-udev-bridge jobs running.
The ssh job starts OK when I connect to my box on port 22 but sshd doesn't talk back to me. Its as if it doesn't receive it and cannot accept it. Retrying to connect will not help, even sshd is now running and should be accepting the connections normally. Upstart is still messing with it!
When an incoming connection is detected, the file descriptor representing the socket is passed to the job in question to allow it to accept(2) the connection. Additionally, the environment variable UPSTART_JOB will contain the name of the event ("socket") and the environment variable UPSTART_FDS will contain the number of the file descriptor corresponding to the listening socket.
Does that mean that to take advantage of this, ssh needs specific support to passing socket FD? IF that is the case, it kinda spoils all the fun :/