Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify systemd service files #5830

Merged
merged 5 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
## template:jinja
[Unit]
# https://docs.cloud-init.io/en/latest/explanation/boot.html
Description=Cloud-init: Config Stage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
## template:jinja
[Unit]
# https://docs.cloud-init.io/en/latest/explanation/boot.html
Description=Cloud-init: Final Stage
After=network-online.target time-sync.target cloud-config.service rc-local.service
{% if variant in ["ubuntu", "unknown", "debian"] %}
After=multi-user.target
Before=apt-daily.service
{% endif %}
Wants=network-online.target cloud-config.service
ConditionPathExists=!/etc/cloud/cloud-init.disabled
ConditionKernelCommandLine=!cloud-init=disabled
Expand Down
9 changes: 1 addition & 8 deletions systemd/cloud-init-local.service.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,23 @@ DefaultDependencies=no
{% endif %}
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"] %}
Before=firewalld.target
Conflicts=shutdown.target
{% endif %}
{% if variant in ["ubuntu", "unknown", "debian"] %}
Before=sysinit.target
Conflicts=shutdown.target
{% endif %}
Conflicts=shutdown.target
ConditionPathExists=!/etc/cloud/cloud-init.disabled
ConditionKernelCommandLine=!cloud-init=disabled
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
Expand Down
2 changes: 0 additions & 2 deletions systemd/cloud-init-main.service.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions systemd/cloud-init-network.service.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down