From 9bb0a882b21e17e0a1033e0a9d90aa92dbd9926b Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Fri, 18 Oct 2024 10:51:55 -0600 Subject: [PATCH] chore: remove unnecessary systemd settings (#5830) - RHEL family distros use ds-identify, and therefore the run directory is already made and ds-identify will have created the enabled file. - network.service doesn't appear to ever have been used, and was probably intended to be network.target. --- systemd/cloud-init-local.service.tmpl | 5 ----- systemd/cloud-init-main.service.tmpl | 2 -- systemd/cloud-init-network.service.tmpl | 2 -- 3 files changed, 9 deletions(-) diff --git a/systemd/cloud-init-local.service.tmpl b/systemd/cloud-init-local.service.tmpl index 3c2c03194c7..59a8110e7cb 100644 --- a/systemd/cloud-init-local.service.tmpl +++ b/systemd/cloud-init-local.service.tmpl @@ -8,9 +8,6 @@ DefaultDependencies=no Wants=network-pre.target After=hv_kvp_daemon.service Before=NetworkManager.service -{% if variant in ["almalinux", "cloudlinux", "rhel"] %} -Before=network.service -{% endif %} Before=network-pre.target Before=shutdown.target {% if variant in ["almalinux", "cloudlinux", "rhel"] %} @@ -28,9 +25,7 @@ ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled [Service] Type=oneshot {% if variant in ["almalinux", "cloudlinux", "rhel"] %} -ExecStartPre=/bin/mkdir -p /run/cloud-init ExecStartPre=/sbin/restorecon /run/cloud-init -ExecStartPre=/usr/bin/touch /run/cloud-init/enabled {% endif %} # This service is a shim which preserves systemd ordering while allowing a # single Python process to run cloud-init's logic. This works by communicating diff --git a/systemd/cloud-init-main.service.tmpl b/systemd/cloud-init-main.service.tmpl index 2cabb79b5bf..b80f324fe7a 100644 --- a/systemd/cloud-init-main.service.tmpl +++ b/systemd/cloud-init-main.service.tmpl @@ -32,9 +32,7 @@ KillMode=process TasksMax=infinity TimeoutStartSec=infinity {% if variant in ["almalinux", "cloudlinux", "rhel"] %} -ExecStartPre=/bin/mkdir -p /run/cloud-init ExecStartPre=/sbin/restorecon /run/cloud-init -ExecStartPre=/usr/bin/touch /run/cloud-init/enabled {% endif %} # Output needs to appear in instance console output diff --git a/systemd/cloud-init-network.service.tmpl b/systemd/cloud-init-network.service.tmpl index 1269b416206..af09fff35cd 100644 --- a/systemd/cloud-init-network.service.tmpl +++ b/systemd/cloud-init-network.service.tmpl @@ -18,8 +18,6 @@ After=networking.service {% if variant in ["almalinux", "centos", "cloudlinux", "eurolinux", "fedora", "miraclelinux", "openeuler", "OpenCloudOS", "openmandriva", "rhel", "rocky", "suse", "TencentOS", "virtuozzo"] %} - -After=network.service After=NetworkManager.service After=NetworkManager-wait-online.service {% endif %}