Added new script files
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b673bcd3 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b673bcd3 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b673bcd3 Branch: refs/heads/master Commit: b673bcd34c3b529824ff15fb9f121c3087df81fa Parents: aedabdb Author: Shameera Rathnayaka <[email protected]> Authored: Tue Jun 21 17:20:04 2016 -0400 Committer: Shameera Rathnayaka <[email protected]> Committed: Tue Jun 28 16:32:37 2016 -0400 ---------------------------------------------------------------------- .../main/resources/bin/airavata-server-start.sh | 99 ++++++++++++++++++++ .../main/resources/bin/airavata-server-stop.sh | 70 ++++++++++++++ 2 files changed, 169 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/b673bcd3/distribution/src/main/resources/bin/airavata-server-start.sh ---------------------------------------------------------------------- diff --git a/distribution/src/main/resources/bin/airavata-server-start.sh b/distribution/src/main/resources/bin/airavata-server-start.sh new file mode 100644 index 0000000..44adad0 --- /dev/null +++ b/distribution/src/main/resources/bin/airavata-server-start.sh @@ -0,0 +1,99 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +. `dirname $0`/setenv.sh +cd ${AIRAVATA_HOME}/bin +LOGO_FILE="logo.txt" + +JAVA_OPTS="" +AIRAVATA_COMMAND="" +EXTRA_ARGS="" +IS_DAEMON_MODE=false +LOGO=true + +# parse command arguments +for var in "$@" +do + case ${var} in + -xdebug) + AIRAVATA_COMMAND="${AIRAVATA_COMMAND}" + JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000" + shift + ;; + -security) + JAVA_OPTS="${JAVA_OPTS} -Djava.security.manager -Djava.security.policy=${AIRAVATA_HOME}/conf/axis2.policy -Daxis2.home=${AIRAVATA_HOME}" + shift + ;; + api | gfac | orchestrator) + AIRAVATA_COMMAND="${AIRAVATA_COMMAND} ${var}" + shift + ;; + -d) + IS_DAEMON_MODE=true + shift + ;; + -nologo) + LOGO=false + shift + ;; + -h) + echo "Usage: airavata-server-start.sh [server-name/s] [command-options]" + echo "Server names:" + echo " api Start api server" + echo " gfac Start api server" + echo " orchestrator Start api server" + + echo "command options:" + echo " -d Start server in daemon mode" + echo " --<key>[=<value>] Server setting(s) to override or introduce (overrides values in airavata-server.properties)" + echo " -nologo Do not show airavata logo" + echo " -xdebug Start Airavata Server under JPDA debugger" + echo " -security Enable Java 2 security" + echo " -h Display this help and exit" + shift + exit 0 + ;; + *) + EXTRA_ARGS="${EXTRA_ARGS} ${var}" + shift + ;; + esac +done + +#add extra argument to the +AIRAVATA_COMMAND="${AIRAVATA_COMMAND} ${EXTRA_ARGS}" + +#print logo file +if ${LOGO} ; then + if [ -e ${LOGO_FILE} ] + then + cat ${LOGO_FILE} + fi +fi + + +if ${IS_DAEMON_MODE} ; then + echo "Starting airavata server/s in daemon mode..." + nohup java ${JAVA_OPTS} -classpath "${AIRAVATA_CLASSPATH}" \ + org.apache.airavata.server.ServerMain ${AIRAVATA_COMMAND} $* > /dev/null 2>&1 & +else + java ${JAVA_OPTS} -classpath "${AIRAVATA_CLASSPATH}" \ + org.apache.airavata.server.ServerMain ${AIRAVATA_COMMAND} $* +fi + http://git-wip-us.apache.org/repos/asf/airavata/blob/b673bcd3/distribution/src/main/resources/bin/airavata-server-stop.sh ---------------------------------------------------------------------- diff --git a/distribution/src/main/resources/bin/airavata-server-stop.sh b/distribution/src/main/resources/bin/airavata-server-stop.sh new file mode 100644 index 0000000..9ef6681 --- /dev/null +++ b/distribution/src/main/resources/bin/airavata-server-stop.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +. `dirname $0`/setenv.sh +cd ${AIRAVATA_HOME}/bin + +JAVA_OPTS="" +AIRAVATA_COMMAND="" +FORCE=false + +for var in "$@" +do + case ${var} in + -f | --force) + FORCE=true + shift + ;; + -h) + echo "Usage: airavata-server-stop.sh [command-options]" + echo "command options:" + echo " -f , --force Force stop all airavata servers." + echo " --<key>[=<value>] Server setting(s) to override or introduce (overrides values in airavata-server.properties)" + echo " -h Display this help and exit" + shift + exit 0 + ;; + *) + shift + esac +done + +if ${FORCE} ; then + for f in `find . -name "server-start_*"`; do + f_split=(${f//_/ }); + echo "Found process file : $f" + echo -n " Sending kill signals to process ${f_split[1]}..." + out=`kill -9 ${f_split[1]} 2>&1` + if [ -z "$out" ]; then + echo "done" + else + echo "failed (REASON: $out)" + fi + echo -n " Removing process file..." + out=`rm ${f} 2>&1` + if [ -z "$out" ]; then + echo "done" + else + echo "failed (REASON: $out)" + fi + done +else + java ${JAVA_OPTS} -classpath "${AIRAVATA_CLASSPATH}" \ + org.apache.airavata.server.ServerMain stop ${AIRAVATA_COMMAND} $* +fi
