From 21fe449c949057dc5b741a2e97843a6965b2c22e Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mar 29 2019 13:50:53 +0000 Subject: Call cat /etc/machine-id just once in %post scriptlet --- diff --git a/systemd.spec b/systemd.spec index 4b72261..ccd76a7 100644 --- a/systemd.spec +++ b/systemd.spec @@ -508,8 +508,9 @@ if [ $1 -eq 1 ] && [ -w %{_localstatedir} ]; then fi # Make sure new journal files will be owned by the "systemd-journal" group -chgrp systemd-journal /run/log/journal/ /run/log/journal/`cat /etc/machine-id 2>/dev/null` /var/log/journal/ /var/log/journal/`cat /etc/machine-id 2>/dev/null` &>/dev/null || : -chmod g+s /run/log/journal/ /run/log/journal/`cat /etc/machine-id 2>/dev/null` /var/log/journal/ /var/log/journal/`cat /etc/machine-id 2>/dev/null` &>/dev/null || : +machine_id=$(cat /etc/machine-id 2>/dev/null) +chgrp systemd-journal /{run,var}/log/journal/{,${machine_id}} &>/dev/null || : +chmod g+s /{run,var}/log/journal/{,${machine_id}} &>/dev/null || : # Apply ACL to the journal directory setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/ &>/dev/null || :