summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorRyan Harper <ryan.harper@canonical.com>2021-10-12 09:31:36 -0500
committerGitHub <noreply@github.com>2021-10-12 09:31:36 -0500
commitb3e31ba228d32c318872fb68edda272f679e1004 (patch)
treea942dc0ee783dfafa9884b5cf566434c48efacfd /packages
parent76166caff42b82aa55c6bcd9528f2c1e3575232a (diff)
downloadvyos-cloud-init-b3e31ba228d32c318872fb68edda272f679e1004.tar.gz
vyos-cloud-init-b3e31ba228d32c318872fb68edda272f679e1004.zip
Inhibit sshd-keygen@.service if cloud-init is active (#1028)
In some cloud-init enabled images the sshd-keygen@.service may race with cloud-init and prevent ssh host keys from being generated or generating host keys twice slowing boot and consuming additional entropy during boot. This drop-in unit adds a condition to the sshd-keygen@.service which prevents running if cloud-init is active.
Diffstat (limited to 'packages')
-rw-r--r--packages/redhat/cloud-init.spec.in1
-rw-r--r--packages/suse/cloud-init.spec.in1
2 files changed, 2 insertions, 0 deletions
diff --git a/packages/redhat/cloud-init.spec.in b/packages/redhat/cloud-init.spec.in
index b930709b..22db4b50 100644
--- a/packages/redhat/cloud-init.spec.in
+++ b/packages/redhat/cloud-init.spec.in
@@ -182,6 +182,7 @@ fi
%if "%{init_system}" == "systemd"
/usr/lib/systemd/system-generators/cloud-init-generator
+%{_sysconfdir}/systemd/system/sshd-keygen@.service.d/disable-sshd-keygen-if-cloud-init-active.conf
%{_unitdir}/cloud-*
%else
%attr(0755, root, root) %{_initddir}/cloud-config
diff --git a/packages/suse/cloud-init.spec.in b/packages/suse/cloud-init.spec.in
index 004b875f..da8107b4 100644
--- a/packages/suse/cloud-init.spec.in
+++ b/packages/suse/cloud-init.spec.in
@@ -126,6 +126,7 @@ version_pys=$(cd "%{buildroot}" && find . -name version.py -type f)
%{_sysconfdir}/dhcp/dhclient-exit-hooks.d/hook-dhclient
%{_sysconfdir}/NetworkManager/dispatcher.d/hook-network-manager
+%{_sysconfdir}/systemd/system/sshd-keygen@.service.d/disable-sshd-keygen-if-cloud-init-active.conf
# Python code is here...
%{python_sitelib}/*