From abe1a6f6482433ef87844419bf4f620e780f3cda Mon Sep 17 00:00:00 2001 From: Derek Richard Date: Fri, 10 Oct 2025 22:31:22 -0400 Subject: [PATCH] The current behavior breaks rsyslog when using the docker cpi and starting with systemd - Defaulting to rsyslog until the majority, if not most, components move completely to noble+ stemcells enables the largest compatibility window --- jobs/syslog_forwarder/templates/pre-start.erb | 13 ++++++------- jobs/syslog_storer/templates/pre-start.erb | 11 +++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/jobs/syslog_forwarder/templates/pre-start.erb b/jobs/syslog_forwarder/templates/pre-start.erb index 585f81c2..cbcb3622 100644 --- a/jobs/syslog_forwarder/templates/pre-start.erb +++ b/jobs/syslog_forwarder/templates/pre-start.erb @@ -51,12 +51,11 @@ chmod 0644 /etc/rsyslog.d/40-syslog-release-file-exclusion.conf <% end %> -# Restart rsyslog: try systemctl first; if it fails (e.g., systemctl missing, -# service not managed by systemd, or VM partially stopped), fall back to -# the traditional service command. This ensures rsyslog starts reliably +# Restart rsyslog: try service first; if it fails (e.g., service missing, +# or VM partially stopped), fall back to systemctl. This ensures rsyslog starts reliably. # across BOSH Lite, stopped VMs, or environments with partial systemd support. echo "Restarting rsyslog..." -systemctl restart rsyslog 2>/dev/null || { - echo "systemctl restart failed, falling back to service..." - service rsyslog restart || echo "fallback restart also failed." -} +service rsyslog restart 2>/dev/null || { + echo "service restart failed, falling back to systemctl..." + systemctl restart rsyslog || echo "fallback restart also failed." +} \ No newline at end of file diff --git a/jobs/syslog_storer/templates/pre-start.erb b/jobs/syslog_storer/templates/pre-start.erb index e7ac2834..b7181883 100644 --- a/jobs/syslog_storer/templates/pre-start.erb +++ b/jobs/syslog_storer/templates/pre-start.erb @@ -16,12 +16,11 @@ if [ -d "/etc/apparmor.d/rsyslog.d/" ]; then fi fi -# Restart rsyslog: try systemctl first; if it fails (e.g., systemctl missing, -# service not managed by systemd, or VM partially stopped), fall back to -# the traditional service command. This ensures rsyslog starts reliably +# Restart rsyslog: try service first; if it fails (e.g., service missing, +# or VM partially stopped), fall back to systemctl. This ensures rsyslog starts reliably. # across BOSH Lite, stopped VMs, or environments with partial systemd support. echo "Restarting rsyslog..." -systemctl restart rsyslog 2>/dev/null || { - echo "systemctl restart failed, falling back to service..." - service rsyslog restart || echo "fallback restart also failed." +service rsyslog restart 2>/dev/null || { + echo "service restart failed, falling back to systemctl..." + systemctl restart rsyslog || echo "fallback restart also failed." }