[systemd-devel] Socket activated SSHD service showing up as a failure when the client connection fReply-To:

Roger Qiu roger.qiu at polycademy.com
Wed Jul 16 19:53:01 PDT 2014


Hello,

This is the log of the status codes:

```
● sshd at 3-10.0.2.15:22-10.0.2.2:51014.service - SSH Daemon (10.0.2.2:51014)
    Loaded: loaded 
(/nix/store/wr8r8jrj204q3i0v4vfav8m63ssnv8w1-unit/sshd at .service)
    Active: failed (Result: exit-code) since Thu 2014-07-17 02:24:01 
UTC; 2min 21s ago
   Process: 3102 
ExecStart=/nix/store/2wc50fcn54axkg2kk71jm2r5h0w5rbh6-openssh-6.6p1/sbin/sshd 
-i -f /nix/store/ai2a554az21b5zhd1kamcznbim4gd924-sshd_config 
(code=exited, status=255)
   Process: 3100 
ExecStartPre=/nix/store/i5wnidc4707k3pgcbhyjq3qb4ajgyx5n-unit-script/bin/sshd at -pre-start 
(code=exited, status=0/SUCCESS)
  Main PID: 3102 (code=exited, status=255)

Jul 17 02:23:55 matrix-node systemd[1]: Started SSH Daemon (10.0.2.2:51014).
Jul 17 02:24:01 matrix-node systemd[1]: 
sshd at 3-10.0.2.15:22-10.0.2.2:51014.service: main process exited, 
code=exited, status=255/n/a
Jul 17 02:24:01 matrix-node systemd[1]: Unit 
sshd at 3-10.0.2.15:22-10.0.2.2:51014.service entered failed state.
```

Perhaps it's 255?

Thanks,
Roger

On 17/07/2014 12:51 PM, Zbigniew Jędrzejewski-Szmek wrote:
> On Thu, Jul 17, 2014 at 12:40:59PM +1000, Roger Qiu wrote:
>> Hello everybody,
>>
>> I recently discovered that when using a socket activated SSHD
>> service on NixOS, it will show up as a failure on `sudo systemctl
>> status` when the client fails the connection.
>>
>> The details are in this issue: https://github.com/NixOS/nixpkgs/issues/3279
>>
>> Basically all I need to do is telnet to my VM and of course fail the
>> protocol, then run `sudo systemctl status` on the VM, and see 1
>> extra failure.
>>
>> Is this correct behaviour for a service to be considered a failure
>> just because the client fails the connection protocol?
> sshd chooses to exit with a failure code in this case. What we should really
> do is add SuccessExitStatus= setting to the sshd at .service and ignore that
> code. Is it some specific value?
>
> Zbyszek
>



More information about the systemd-devel mailing list