#!/bin/sh echo echo "Greenstone 3 (GSDL3)" echo "Copyright (C) 2004 New Zealand Digital Libraries, University Of Waikato" echo "Greenstone 3 comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt" echo "This is free software, and you are welcome to redistribute it" echo ## -------- gs3-setup.sh -------- if [ ! -f gs3-setup.sh ]; then echo "You must run this script from within the Greenstone 3 home directory" exit 1 fi #set up the environment source gs3-setup.sh #set up java options for catalina CATALINA_OPTS="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M" export CATALINA_OPTS if [ "$1" != "-shutdown" ]; then ## -------- Run MySQL -------- echo "Starting MySQL Daemon..." echo "" pushd $GSDL3HOME/packages/mysql ./bin/mysqld_safe --basedir=. --datadir=./data --err-log=./var/log/mysql.log --socket=/tmp/mysql.sock --user=root --pid_file=gsdl3.pid & popd echo "Done." ## -------- Run Tomcat -------- echo "Starting Tomcat Webserver..." echo "" pushd $GSDL3HOME/comms/jakarta/tomcat/bin ./startup.sh popd echo "Done. It will be ready in a minute." ## -------- Greenstone 3 -------- echo "" echo "****************************************************************" echo "Greenstone collections will start being served in several" echo "minutes. Use your browser to view the Greenstone collections by" echo "choosing to:" echo "" echo " 'run the library servlet'" echo "" echo "from the page shown at:" echo "" echo " http://localhost:8080/gsdl3" echo "" echo "To cease serving greenstone collections please run this file" echo "again but provide the shutdown argument like so:" echo "" echo " gs3-launch.sh -shutdown" echo "" echo "****************************************************************" echo "" else ## -------- Stop Tomcat -------- echo "Shutting Down Tomcat Webserver..." echo "" pushd $GSDL3HOME/comms/jakarta/tomcat/bin ./shutdown.sh popd echo "Done." ## -------- Stop MySQL -------- echo "Stop MySQL Daemon..." echo "" pushd $GSDL3HOME/packages/mysql ./bin/mysqladmin --user=root --socket=/tmp/mysql.sock shutdown popd #./gs3-mysql-server.sh stop echo "Done." ## -------- Greenstone 3 -------- echo "****************************************************************" echo " Greenstone 3 has been shutdown. Run gs3-launch.sh to restart." echo "****************************************************************" fi exit 0