Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1198207

Bug#1071594: debhelper: fails to start openssh-server after creating host keys due to systemd 255 change

From Lucas Nussbaum <lucas@debian.org>
Newsgroups linux.debian.bugs.dist
Subject Bug#1071594: debhelper: fails to start openssh-server after creating host keys due to systemd 255 change
Date 2024-05-21 22:10 +0200
Message-ID <IGDY5-eUY4-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Package: debhelper
Version: 13.15.3
Severity: normal

Hi,

I maintain the Debian Vagrant boxes. Recently, booting the 'testing'
image started to fail randomly.
The Debian Vagrant images ship without SSH host keys. A systemd service
is responsible for triggering a 'dpkg-reconfigure openssh-server' that
will generate the ssh keys and then start ssh.

Until systemd v254.5-1, that worked fine:
ssh.service was started but fails to start;
we get the 'ssh.service: Start request repeated too quickly.' error;
dpkg-reconfigure openssh-server creates the key and starts ssh.service
successfully.

With v255.2-1, that no longer works.
If ssh.service reached the 'Start request repeated too quickly.' state,
dpkg-reconfigure openssh-server is no longer able to start it.

The following code is in charge of starting ssh.service:


# Automatically added by dh_installsystemd/13.15.3
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
        if [ -d /run/systemd/system ]; then
                systemctl --system daemon-reload >/dev/null || true
                if [ -n "$2" ]; then
                        _dh_action=restart
                else
                        _dh_action=start
                fi
                deb-systemd-invoke $_dh_action 'ssh.service' >/dev/null || true
        fi
fi
# End automatically added section


A MWE to reproduce is:

systemctl stop ssh
rm /etc/ssh/ssh_host_*
for i in $(seq 1 10); do systemctl start ssh ; done
systemctl status ssh
dpkg-reconfigure openssh-server
systemctl status ssh


I tried to identify when and why it was changed in systemd, but failed.
It could be argued that this is a regression in systemd.

Lucas

Back to linux.debian.bugs.dist | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Bug#1071594: debhelper: fails to start openssh-server after creating host keys due to systemd 255 change Lucas Nussbaum <lucas@debian.org> - 2024-05-21 22:10 +0200
  Bug#1071594: debhelper: fails to start openssh-server after creating host keys due to systemd 255 change Luca Boccassi <bluca@debian.org> - 2024-05-23 21:10 +0200
    Bug#1071594: debhelper: fails to start openssh-server after creating host keys due to systemd 255 change Lucas Nussbaum <lucas@debian.org> - 2024-05-24 11:40 +0200

csiph-web