Skip to content

Commit 5f692bc

Browse files
committed
Skip SELinux fix on non-RHEL distros like SLES
RM #4424404
1 parent eaa5c03 commit 5f692bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rshim.spec.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ make
7878
%endif
7979

8080
%post
81-
if [ -f /etc/os-release ]; then
81+
if [ -f /etc/redhat-release ] && [ -f /etc/os-release ]; then
8282
. /etc/os-release
8383
RHEL_MAJOR=$(echo $VERSION_ID | cut -d '.' -f 1)
8484
RHEL_MINOR=$(echo $VERSION_ID | cut -d '.' -f 2)
@@ -96,7 +96,10 @@ if [ -f /etc/os-release ]; then
9696
echo "SELinux policy tools are not available. rshim policy update failed."
9797
fi
9898
fi
99+
else
100+
echo "Skipping SELinux rshim policy fix on non-supported distribution."
99101
fi
102+
100103
%if "%{with_systemd}" == "1"
101104
echo "Installation complete. To enable and start the rshim service, run:"
102105
echo " systemctl daemon-reload"
@@ -117,7 +120,6 @@ fi
117120

118121
%postun
119122
if [ $1 -eq 0 ] && [ -x /usr/sbin/semodule ] && semodule -l | grep -q '^rshim-fix\b'; then
120-
echo "Removing SELinux rshim-fix policy..."
121123
semodule -r rshim-fix >/dev/null 2>&1 || true
122124
fi
123125

0 commit comments

Comments
 (0)