| 59 | 7. Create the script `run_open_specimen.sh`: |
| 60 | |
| 61 | {{{ |
| 62 | #!/bin/bash |
| 63 | |
| 64 | unset JAVA_TOOL_OPTIONS |
| 65 | export JAVA_ROOT=/usr/lib64/jvm/java |
| 66 | export JDK_HOME=/usr/lib64/jvm/java |
| 67 | export SDK_HOME=/usr/lib64/jvm/java |
| 68 | export JAVA_BINDIR=/usr/lib64/jvm/java/bin |
| 69 | export JRE_HOME=/usr/lib64/jvm/java/jre |
| 70 | JAVA_HOME=/opt/java |
| 71 | JRE_HOME=/opt/java/jre |
| 72 | OPEN_SPECIMEN_DIR=/local/{Open Specimen Directory}/app |
| 73 | |
| 74 | export JAVA_TOOL_OPTIONS=-XX:CompressedClassSpaceSize=10m |
| 75 | export JAVA_OPTS="-Xmx2G -XX:-UseCompressedClassPointers" |
| 76 | |
| 77 | $OPEN_SPECIMEN_DIR/bin/catalina.sh start >$OPEN_SPECIMEN_DIR/logs/tomcat-start.log 2>$OPEN_SPECIMEN_DIR/logs/tomcat-start.err & |
| 78 | }}} |
| 79 | |
| 80 | 8. Create the script `stop_open_specimen.sh`: |
| 81 | |
| 82 | {{{ |
| 83 | #!/bin/bash |
| 84 | |
| 85 | unset JAVA_TOOL_OPTIONS |
| 86 | export JAVA_ROOT=/usr/lib64/jvm/java |
| 87 | export JDK_HOME=/usr/lib64/jvm/java |
| 88 | export SDK_HOME=/usr/lib64/jvm/java |
| 89 | export JAVA_BINDIR=/usr/lib64/jvm/java/bin |
| 90 | export JRE_HOME=/usr/lib64/jvm/java/jre |
| 91 | JAVA_HOME=/opt/java |
| 92 | JRE_HOME=/opt/java/jre |
| 93 | OPEN_SPECIMEN_DIR=/local/openSpecimen_v2_4/app |
| 94 | |
| 95 | export JAVA_TOOL_OPTIONS=-XX:CompressedClassSpaceSize=10m |
| 96 | export JAVA_OPTS="-Xmx2G -XX:-UseCompressedClassPointers" |
| 97 | |
| 98 | $OPEN_SPECIMEN_DIR/bin/catalina.sh stop |
| 99 | }}} |
| 100 | |
| 101 | 9. Give `www-run` account permission to run the scripts: |
| 102 | |
| 103 | {{{ |
| 104 | setfacl -m u:wwwrun:rx /local/{Open Specimen Directory}/run_open_specimen.sh |
| 105 | setfacl -m u:wwwrun:rx /local/{Open Specimen Directory}/stop_open_specimen.sh |
| 106 | }}} |
| 107 | |
| 108 | 10. Give `www-run` permission to write to the logs and work directories: |
| 109 | |
| 110 | {{{ |
| 111 | setfacl -R -m u:wwwrun:rwx /local/{Open Specimen Directory}/logs/ |
| 112 | setfacl -R -m u:wwwrun:rwx /local/{Open Specimen Directory}/work/ |
| 113 | }}} |
| 114 | |
| 115 | 11. Give `www-run` permission to run Tomcat: |
| 116 | {{{ |
| 117 | setfacl -m u:wwwrun:rx /local/{Open Specimen Directory}/app/bin/catalina.sh |
| 118 | }}} |
| 119 | |