diff --git a/jetty.sh b/jetty.sh index 5f44bbb..0feddde 100644 --- a/jetty.sh +++ b/jetty.sh @@ -2,15 +2,15 @@ # Configuration files # # /etc/default/jetty -# If it exists, this is read at the start of script. It may perform any +# If it exists, this is read at the start of script. It may perform any # sequence of shell commands, like setting relevant environment variables. # # /etc/jetty.conf # If found, and no configurations were given on the command line, -# the file will be used as this script's configuration. +# the file will be used as this script's configuration. # Each line in the file may contain: # - A comment denoted by the pound (#) sign as first non-blank character. -# - The path to a regular file, which will be passed to jetty as a +# - The path to a regular file, which will be passed to jetty as a # config.xml file. # - The path to a directory. Each *.xml file in the directory will be # passed to jetty as a config.xml file. @@ -71,12 +71,12 @@ fi cd "$JETTY_BASE" JETTY_BASE="$PWD" -if [ -z "$JETTY_CONF" ] +if [ -z "$JETTY_CONF" ] then JETTY_CONF=/etc/jetty.conf fi -if [ -f "$JETTY_CONF" ] && [ -r "$JETTY_CONF" ] +if [ -f "$JETTY_CONF" ] && [ -r "$JETTY_CONF" ] then while read -r CONF do @@ -84,18 +84,18 @@ then continue fi - if [ -d "$CONF" ] + if [ -d "$CONF" ] then # assume it's a directory with configure.xml files # for example: /etc/jetty.d/ # sort the files before adding them to the list of JETTY_ARGS for XMLFILE in "$CONF/"*.xml do - if [ -r "$XMLFILE" ] && [ -f "$XMLFILE" ] + if [ -r "$XMLFILE" ] && [ -f "$XMLFILE" ] then JETTY_ARGS+=("$XMLFILE") else - echo "** WARNING: Cannot read '$XMLFILE' specified in '$JETTY_CONF'" + echo "** WARNING: Cannot read '$XMLFILE' specified in '$JETTY_CONF'" fi done else @@ -113,7 +113,7 @@ then JAVA="$JAVACMD" fi -if [ -z "$JETTY_LOGS" ] && [ -d $JETTY_BASE/logs ] +if [ -z "$JETTY_LOGS" ] && [ -d $JETTY_BASE/logs ] then JETTY_LOGS=/var/log/jetty/logs fi @@ -133,4 +133,18 @@ 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 diff --git a/jetty.spec b/jetty.spec index 8924677..12caf21 100644 --- a/jetty.spec +++ b/jetty.spec @@ -55,7 +55,7 @@ Name: jetty Version: 9.1.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Java Webserver and Servlet Container # Jetty is dual licensed under both ASL 2.0 and EPL 1.0, see NOTICE.txt @@ -658,9 +658,6 @@ install -dm 755 %{buildroot}%{_unitdir} # systemd unit file cp %{SOURCE5} %{buildroot}%{_unitdir}/ -# replace the startup script with ours -cp -p %{SOURCE1} %{buildroot}%{homedir}/ - # main pkg tar xvf jetty-distribution/target/%{name}-distribution-%{version}.%{addver}.tar.gz -C %{buildroot}%{homedir} mv %{buildroot}%{homedir}/%{name}-distribution-%{version}.%{addver}/* %{buildroot}%{homedir}/ @@ -750,6 +747,9 @@ rm %{buildroot}%{homedir}/*.txt %{buildroot}%{homedir}/*.html # See: https://bugzilla.redhat.com/show_bug.cgi?id=845993 ln -sf %{rundir} %{buildroot}%{homedir}/work +# replace the startup script with ours +cp -p %{SOURCE1} %{buildroot}%{homedir}/bin/jetty.sh + %pre # Add the "jetty" user and group getent group %username >/dev/null || groupadd -f -g %jtuid -r %username @@ -794,6 +794,7 @@ exit 0 %dir %{jettylibdir} %dir %{jettycachedir} %{homedir} +%attr(744, jetty, jetty) %{homedir}/bin/jetty.sh %attr(755, jetty, jetty) %{logdir} %attr(755, jetty, jetty) %{tempdir} %ghost %dir %attr(755, jetty, jetty) %{rundir} @@ -868,6 +869,10 @@ exit 0 %doc NOTICE.txt LICENSE* %changelog +* Thu Apr 10 2014 Michael Simacek - 9.1.4-2 +- Install startup script into correct directory +- Add a notice about httpd_execmem into the startup script + * Tue Apr 08 2014 Michael Simacek - 9.1.4-1 - Update to upstream version 9.1.4