Fix selinux context for unbound.log
The previous patch[1] applied a partial context to the unbound.log file. This patch applies a full context to resolve the "partial context" error, using semanage to make the file label persistent. [1] https://review.opendev.org/c/openstack/project-config/+/841546 Change-Id: Ic15957fa4ef58355efd2e96f143386f393b0a59d
This commit is contained in:
@@ -98,8 +98,9 @@ chmod 0644 /var/log/unbound.log
|
|||||||
# distros, but for consistency it's much easier if we just have one
|
# distros, but for consistency it's much easier if we just have one
|
||||||
# log file in the same place across distros. Thus set the context to
|
# log file in the same place across distros. Thus set the context to
|
||||||
# allow it.
|
# allow it.
|
||||||
if [[ -e /usr/bin/chcon ]]; then
|
if [[ -e /usr/sbin/semanage ]]; then
|
||||||
chcon -t named_log_t /var/log/unbound.log
|
semanage fcontext -a -t named_log_t /var/log/unbound.log
|
||||||
|
restorecon -v /var/log/unbound.log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$DISTRO_NAME" =~ (opensuse) ]] ; then
|
if [[ "$DISTRO_NAME" =~ (opensuse) ]] ; then
|
||||||
|
|||||||
Reference in New Issue
Block a user