Changeset 36583


Ignore:
Timestamp:
2022-09-06T17:35:33+12:00 (3 weeks ago)
Author:
davidb
Message:

Need a more carefully constructed way of starting Tomcat with _RUNJAVA specifying xvfb-run-java (when required), but also stopping Tomcat with a regular java (i.e., not the xvfb-run-java version. Solution take is to have gs3-setup.sh set an enviroment variable for this, when bash-script confirms xvfb-run-java is needed

Location:
main/trunk/greenstone3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/bin/script/xvfb-run-java

    r36541 r36583  
    11#!/bin/bash
    22
    3 xvfb-run java $*
     3xvfb-run java "$@"
    44
  • main/trunk/greenstone3/build.xml

    r36573 r36583  
    27682768      <env key="WNHOME" path="${wn.home}"/>
    27692769      <env key="FEDORA_HOME" path="${fedora.home}"/>
     2770
     2771      <env key="_RUNJAVA" value="${env.CATALINA_START_RUNJAVA}"/>
    27702772      <arg value="${catalina.home}/bin/startup.sh"/>
    27712773    </exec>
  • main/trunk/greenstone3/gs3-setup.sh

    r36543 r36583  
    576576# work out if the system is capable of running webswing
    577577#
    578 # => If a headless server, then needs 'xvfb-run'
     578# => If it can, but is a headless server, then needs 'xvfb-run'
     579
     580export CATALINA_START_RUNJAVA=""
    579581
    580582if [ -f packages/tomcat/webapps/webswing-server.war ] ; then
     
    582584    if [ "$GSDLOS" = "linux" ] && [ "x$DISPLAY" = "x" ] ; then
    583585    # a headless linux server
    584     # => need xvfb-run to be able to operate webswing-server.jar
     586    # => need xvfb-run to be able to operate webswing-server.war
    585587   
    586588    command -v xvfb-run > /dev/null 2>&1
    587589    if [ $? = 0 ] ; then
    588         echo "Setting _RUNJAVA to 'xvfb-run-java'"
     590        echo "Setting CATALINA_START_RUNJAVA to '$GSDL3SRCHOME/bin/script/xvfb-run-java'"
    589591        echo "  => Allows webswing-server.war to graphically render on headless server"
    590         export _JAVARUN="xvfb-run-java"
     592        export CATALINA_START_RUNJAVA="$GSDL3SRCHOME/bin/script/xvfb-run-java"
    591593    else
    592594        echo "Warning: No DISPLAY variable set     => looks like a headless server"
    593         echo "         Unable to detect 'xvfb-run' => webswing-server.war will not function"
     595        echo "         Unable to detect 'xvfb-run' => webswing-server.war unlikely to work"
    594596    fi
    595597    echo ""
    596598    fi
    597599fi
     600
    598601
    599602# Ant
Note: See TracChangeset for help on using the changeset viewer.