Call cat /etc/machine-id just once in %post scriptlet
This commit is contained in:
parent
94a4908748
commit
21fe449c94
@ -508,8 +508,9 @@ if [ $1 -eq 1 ] && [ -w %{_localstatedir} ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure new journal files will be owned by the "systemd-journal" group
|
# 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 || :
|
machine_id=$(cat /etc/machine-id 2>/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 || :
|
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
|
# 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 || :
|
setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/ &>/dev/null || :
|
||||||
|
Loading…
Reference in New Issue
Block a user