From d7c3fddda799a1399283cc19da1284e94eee202d Mon Sep 17 00:00:00 2001 From: wqian Date: Wed, 24 Jul 2024 13:53:38 +0100 Subject: [PATCH] Remove the existing recursive line --- .../journald/dir_groupowner_system_journal/bash/ubuntu.sh | 3 +++ .../logging/journald/dir_owner_system_journal/bash/ubuntu.sh | 3 +++ .../journald/dir_permissions_system_journal/bash/ubuntu.sh | 3 +++ .../journald/file_groupowner_system_journal/bash/ubuntu.sh | 3 +++ .../logging/journald/file_owner_system_journal/bash/ubuntu.sh | 3 +++ .../journald/file_permissions_system_journal/bash/ubuntu.sh | 3 +++ 6 files changed, 18 insertions(+) diff --git a/linux_os/guide/system/logging/journald/dir_groupowner_system_journal/bash/ubuntu.sh b/linux_os/guide/system/logging/journald/dir_groupowner_system_journal/bash/ubuntu.sh index 8026f58fb650..cab35693c27e 100644 --- a/linux_os/guide/system/logging/journald/dir_groupowner_system_journal/bash/ubuntu.sh +++ b/linux_os/guide/system/logging/journald/dir_groupowner_system_journal/bash/ubuntu.sh @@ -1,6 +1,9 @@ # platform = multi_platform_ubuntu TMPFILES_CONF="/etc/tmpfiles.d/00-systemd.conf" +ORIGINAL_CONF="/usr/lib/tmpfiles.d/systemd.conf" + +sed -i --follow-symlinks -E '/[zZ][+]*\s+\/(var|run)\/log\/journal\s*/d' "$ORIGINAL_CONF" if grep -qP "^.[+]*\s+\/var\/log\/journal\s+" "$TMPFILES_CONF"; then sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/var\/log\/journal\s\+[^ $]\+\s\+[^ $]\+\s\+\)\([^ $]\+\)/Z\2systemd-journal/" "$TMPFILES_CONF" diff --git a/linux_os/guide/system/logging/journald/dir_owner_system_journal/bash/ubuntu.sh b/linux_os/guide/system/logging/journald/dir_owner_system_journal/bash/ubuntu.sh index 226febdff0c9..c5295eb041b6 100644 --- a/linux_os/guide/system/logging/journald/dir_owner_system_journal/bash/ubuntu.sh +++ b/linux_os/guide/system/logging/journald/dir_owner_system_journal/bash/ubuntu.sh @@ -1,6 +1,9 @@ # platform = multi_platform_ubuntu TMPFILES_CONF="/etc/tmpfiles.d/00-systemd.conf" +ORIGINAL_CONF="/usr/lib/tmpfiles.d/systemd.conf" + +sed -i --follow-symlinks -E '/[zZ][+]*\s+\/(var|run)\/log\/journal\s*/d' "$ORIGINAL_CONF" if grep -qP "^.[+]*\s+\/var\/log\/journal\s+" "$TMPFILES_CONF"; then sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/var\/log\/journal\s\+[^ $]\+\s\+\)\([^ $]\+\)/Z\2root/" "$TMPFILES_CONF" diff --git a/linux_os/guide/system/logging/journald/dir_permissions_system_journal/bash/ubuntu.sh b/linux_os/guide/system/logging/journald/dir_permissions_system_journal/bash/ubuntu.sh index 148396ad488d..59cd61ea6b4d 100644 --- a/linux_os/guide/system/logging/journald/dir_permissions_system_journal/bash/ubuntu.sh +++ b/linux_os/guide/system/logging/journald/dir_permissions_system_journal/bash/ubuntu.sh @@ -1,6 +1,9 @@ # platform = multi_platform_ubuntu TMPFILES_CONF="/etc/tmpfiles.d/00-systemd.conf" +ORIGINAL_CONF="/usr/lib/tmpfiles.d/systemd.conf" + +sed -i --follow-symlinks -E '/[zZ][+]*\s+\/(var|run)\/log\/journal\s*/d' "$ORIGINAL_CONF" if grep -qP "^.[+]*\s+\/var\/log\/journal\s+" "$TMPFILES_CONF"; then sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/var\/log\/journal\s\+\)\([^ $]*\)/Z\2~2750/" "$TMPFILES_CONF" diff --git a/linux_os/guide/system/logging/journald/file_groupowner_system_journal/bash/ubuntu.sh b/linux_os/guide/system/logging/journald/file_groupowner_system_journal/bash/ubuntu.sh index 8026f58fb650..cab35693c27e 100644 --- a/linux_os/guide/system/logging/journald/file_groupowner_system_journal/bash/ubuntu.sh +++ b/linux_os/guide/system/logging/journald/file_groupowner_system_journal/bash/ubuntu.sh @@ -1,6 +1,9 @@ # platform = multi_platform_ubuntu TMPFILES_CONF="/etc/tmpfiles.d/00-systemd.conf" +ORIGINAL_CONF="/usr/lib/tmpfiles.d/systemd.conf" + +sed -i --follow-symlinks -E '/[zZ][+]*\s+\/(var|run)\/log\/journal\s*/d' "$ORIGINAL_CONF" if grep -qP "^.[+]*\s+\/var\/log\/journal\s+" "$TMPFILES_CONF"; then sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/var\/log\/journal\s\+[^ $]\+\s\+[^ $]\+\s\+\)\([^ $]\+\)/Z\2systemd-journal/" "$TMPFILES_CONF" diff --git a/linux_os/guide/system/logging/journald/file_owner_system_journal/bash/ubuntu.sh b/linux_os/guide/system/logging/journald/file_owner_system_journal/bash/ubuntu.sh index 226febdff0c9..c5295eb041b6 100644 --- a/linux_os/guide/system/logging/journald/file_owner_system_journal/bash/ubuntu.sh +++ b/linux_os/guide/system/logging/journald/file_owner_system_journal/bash/ubuntu.sh @@ -1,6 +1,9 @@ # platform = multi_platform_ubuntu TMPFILES_CONF="/etc/tmpfiles.d/00-systemd.conf" +ORIGINAL_CONF="/usr/lib/tmpfiles.d/systemd.conf" + +sed -i --follow-symlinks -E '/[zZ][+]*\s+\/(var|run)\/log\/journal\s*/d' "$ORIGINAL_CONF" if grep -qP "^.[+]*\s+\/var\/log\/journal\s+" "$TMPFILES_CONF"; then sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/var\/log\/journal\s\+[^ $]\+\s\+\)\([^ $]\+\)/Z\2root/" "$TMPFILES_CONF" diff --git a/linux_os/guide/system/logging/journald/file_permissions_system_journal/bash/ubuntu.sh b/linux_os/guide/system/logging/journald/file_permissions_system_journal/bash/ubuntu.sh index 148396ad488d..71e190346f9f 100644 --- a/linux_os/guide/system/logging/journald/file_permissions_system_journal/bash/ubuntu.sh +++ b/linux_os/guide/system/logging/journald/file_permissions_system_journal/bash/ubuntu.sh @@ -1,6 +1,9 @@ # platform = multi_platform_ubuntu TMPFILES_CONF="/etc/tmpfiles.d/00-systemd.conf" +ORIGINAL_CONF="/usr/lib/tmpfiles.d/systemd.conf" + +sed -i --follow-symlinks -E '/[zZ][+]*\s+\/var\/log\/journal\s*/d' "$ORIGINAL_CONF" if grep -qP "^.[+]*\s+\/var\/log\/journal\s+" "$TMPFILES_CONF"; then sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/var\/log\/journal\s\+\)\([^ $]*\)/Z\2~2750/" "$TMPFILES_CONF"