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

Avoid tmpfiles override #12218

Merged
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,17 +1,19 @@
# platform = multi_platform_ubuntu

TMPFILES_CONF="/etc/tmpfiles.d/systemd.conf"
TMPFILES_CONF="/usr/lib/tmpfiles.d/systemd.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"
else
echo "Z /var/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /var/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/var\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/var\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /var/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

if grep -qP "^.[+]*\s+\/run\/log\/journal\s+" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/run\/log\/journal\s\+[^ $]\+\s\+[^ $]\+\s\+\)\([^ $]\+\)/Z\2systemd-journal/" "$TMPFILES_CONF"
else
echo "Z /run/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /run/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/run\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/run\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /run/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

systemd-tmpfiles --create
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# platform = multi_platform_ubuntu

TMPFILES_CONF="/etc/tmpfiles.d/systemd.conf"
TMPFILES_CONF="/usr/lib/tmpfiles.d/systemd.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"
else
echo "Z /var/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /var/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/var\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/var\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /var/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

if grep -qP "^.[+]*\s+\/run\/log\/journal\s+" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/run\/log\/journal\s\+[^ $]\+\s\+\)\([^ $]\+\)/Z\2root/" "$TMPFILES_CONF"
else
echo "Z /run/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /run/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/run\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/run\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /run/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

systemd-tmpfiles --create
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# platform = multi_platform_ubuntu

TMPFILES_CONF="/etc/tmpfiles.d/systemd.conf"
TMPFILES_CONF="/usr/lib/tmpfiles.d/systemd.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"
else
echo "Z /var/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /var/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/var\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/var\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /var/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

if grep -qP "^.[+]*\s+\/run\/log\/journal\s+" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/run\/log\/journal\s\+\)\([^ $]*\)/Z\2~2750/" "$TMPFILES_CONF"
else
echo "Z /run/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /run/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/run\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/run\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /run/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

systemd-tmpfiles --create
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# platform = multi_platform_ubuntu

TMPFILES_CONF="/etc/tmpfiles.d/systemd.conf"
TMPFILES_CONF="/usr/lib/tmpfiles.d/systemd.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"
else
echo "Z /var/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /var/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/var\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/var\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /var/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

if grep -qP "^.[+]*\s+\/run\/log\/journal\s+" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/run\/log\/journal\s\+[^ $]\+\s\+[^ $]\+\s\+\)\([^ $]\+\)/Z\2systemd-journal/" "$TMPFILES_CONF"
else
echo "Z /run/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /run/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/run\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/run\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /run/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

systemd-tmpfiles --create
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# platform = multi_platform_ubuntu

TMPFILES_CONF="/etc/tmpfiles.d/systemd.conf"
TMPFILES_CONF="/usr/lib/tmpfiles.d/systemd.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"
else
echo "Z /var/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /var/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/var\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/var\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /var/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

if grep -qP "^.[+]*\s+\/run\/log\/journal\s+" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/run\/log\/journal\s\+[^ $]\+\s\+\)\([^ $]\+\)/Z\2root/" "$TMPFILES_CONF"
else
echo "Z /run/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /run/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/run\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/run\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /run/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

systemd-tmpfiles --create
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# platform = multi_platform_ubuntu

TMPFILES_CONF="/etc/tmpfiles.d/systemd.conf"
TMPFILES_CONF="/usr/lib/tmpfiles.d/systemd.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"
else
echo "Z /var/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /var/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/var\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/var\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /var/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

if grep -qP "^.[+]*\s+\/run\/log\/journal\s+" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^.[+]*\)\(\s\+\/run\/log\/journal\s\+\)\([^ $]*\)/Z\2~2750/" "$TMPFILES_CONF"
else
echo "Z /run/log/journal ~2750 root systemd-journal - -" >> "$TMPFILES_CONF"
if ! grep -q 'Z /run/log/journal ~2750 root systemd-journal - -' "$TMPFILES_CONF"; then
if grep -qP "^[zZ][+]*\s+\/run\/log\/journal" "$TMPFILES_CONF"; then
sed -i --follow-symlinks "s/\(^[zZ][+]*\)\(\s\+\/run\/log\/journal.*\)/# \1\2/" "$TMPFILES_CONF"
fi
echo "Z /run/log/journal ~2750 root systemd-journal - -" >>"$TMPFILES_CONF"
fi

systemd-tmpfiles --create
Loading