msimacek pushed to jetty (f21). "Redo workaround for selinux problem"

notifications at fedoraproject.org notifications at fedoraproject.org
Wed Jun 3 12:02:05 UTC 2015


From a09c4c2790effd3d1597a79ed0d7b02d127704fc Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek at redhat.com>
Date: Tue, 2 Jun 2015 10:59:25 +0200
Subject: Redo workaround for selinux problem


diff --git a/jetty.sh b/jetty.sh
index 0feddde..aeefb58 100644
--- a/jetty.sh
+++ b/jetty.sh
@@ -129,22 +129,19 @@ then
   exit 1
 fi
 
+# workaround for httpd_execmem being off by default
+command -v getenforce &>/dev/null && getenforce | fgrep -qi enforcing && getsebool httpd_execmem | grep -q 'off$' \
+&& (
+# chain of echos because journal doesn't show multiline logs correctly
+echo "Warning: Jetty needs SELinux boolean httpd_execmem to be set to work properly."
+echo "To set it, use:"
+echo "setsebool -P httpd_execmem 1"
+echo "to allow execmem acces for processes in the httpd domain. Please bear in mind"
+echo "that this might affect other processess. See man httpd_selinux(8)."
+)
+
 RUN_ARGS=(${JAVA_OPTIONS[@]} -jar "$JETTY_START" ${JETTY_ARGS[*]})
 RUN_CMD=("$JAVA" ${RUN_ARGS[@]})
 
 echo -n "Starting Jetty: "
-set +e
-${RUN_CMD[*]}
-
-RET="$?"
-if [ "$RET" -ne 0 ]; then
-cat << EOF
-If jvm exited with Out of Memory Error it is quite likely that your SELinux
-policy doesn't allow execmem access for the JVM. To solve this problem, use:
-setsebool -P httpd_execmem 1
-to allow execmem acces for processes in the httpd domain. Please bear in mind
-that this might affect other processess. For more information see
-httpd_selinux(8).
-EOF
-exit "$RET"
-fi
+exec ${RUN_CMD[*]}
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/jetty.git/commit/?h=f21&id=a09c4c2790effd3d1597a79ed0d7b02d127704fc


More information about the scm-commits mailing list