Subject: Re: bug#74943: sshd: no hostkeys available -- exiting

From: Ludovic Courtès <[email-masked]>
Date: Tue, 28 Jan 2025 11:56:36 +0100

Hi,

Christopher Baines <[email-masked]> skribis:

> Ludovic Courtès <[email-masked]> writes:
>
>> Hello,
>>
>> Christopher Baines <[email-masked]> skribis:
>>
>>> I'm having trouble with ssh after reconfiguring, in /var/log/messages I
>>> see an error regarding hostkeys. The files seem to be there though, I've
>>> tried regenerating the keys but that made no difference.
>>
>> Could you provide more info, such as the relevant excerpt of
>> /var/log/messages and the config?
>
> I can't quite remember the exact situation, but I think this turned out
> to be connected with the Patchwork service not being compatible with
> current versions of the Shepherd, specifically it tries to use
> primitive-fork while starting [1] and I'm guessing this leads to
> confusing state things happening internally that break SSH.

Oh there’s potential for breakage indeed.  As a rule of thumb, we should
never use ‘primitive-fork’ and ‘waitpid’ in Shepherd services.

In this case, I’d recommend using ‘spawn-command’:

  (spawn-command "…/patchwork-admin"
                 #:environment-variables …
                 #:user …
                 #:group …)

Ludo’.