从rocketmq搬来的一个shell脚本tools.sh
2017-02-04 00:00
615 查看
这个脚本在RocketMQ的,3.2.6版本中。路径是RocketMQ/devenv/bin/tools.sh
使用方法:sh tools.sh com.demo.DemoStart
可以根据自己需要修改配置。
使用方法:sh tools.sh com.demo.DemoStart
可以根据自己需要修改配置。
#!/bin/sh # 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. #=========================================================================================== # Java Environment Setting #=========================================================================================== error_exit () { echo "ERROR: $1 !!" exit 1 } [ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=$HOME/jdk/java [ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=/opt/taobao/java [ ! -e "$JAVA_HOME/bin/java" ] && error_exit "Please set the JAVA_HOME variable in your environment, We need java(x64)!" export JAVA_HOME export JAVA="$JAVA_HOME/bin/java" #设置BASE_DIR为上级目录, dirname $0 当前shell程序路径 export BASE_DIR=$(dirname $0)/.. export CLASSPATH=.:${BASE_DIR}/conf:${CLASSPATH} #=========================================================================================== # JVM Configuration #=========================================================================================== JAVA_OPT="${JAVA_OPT} -server -Xms1g -Xmx1g -Xmn256m -XX:PermSize=128m -XX:MaxPermSize=128m" JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${BASE_DIR}/lib:${JAVA_HOME}/jre/lib/ext" JAVA_OPT="${JAVA_OPT} -cp ${CLASSPATH}" $JAVA ${JAVA_OPT} $@
相关文章推荐
- shell之ssh远程管理(这个脚本就是上一个jump.sh调用的脚本)
- 每天一个linux命令(62):sh命令 /Linux中执行shell脚本的4种方法总结
- shell-001 撰写一个clearlog.sh脚本
- shell脚本中使用自定义命令之三---通过加载一个envsetup.sh实现
- 阿里云提供的一个监测cpu和内存的shell脚本(get_cpu_mem_info.sh)
- linux下如何自动检测并重新启动一个死掉的进程(shell脚本实现)
- 一个shell小脚本
- 如何编写一个shell脚本
- 一个不错的shell 脚本教程
- 如何编写一个shell脚本(转贴)
- 11g R2 运行root.sh脚本不成功的一个例子: 推荐
- 一个shell防火墙的小脚本
- linux下如何自动检测并重新启动一个死掉的进程,然后再把它杀死:)(shell脚本实现)
- 一个SHELL脚本,不让别人登系统
- shell脚本 把一个文件的内容全部转换为大写
- 防止同一个Java应用重复启动的shell脚本
- 自己编写的一个查找Linux进程的Shell脚本
- 建立一个脚本 A Good Shell Tutorial
- 如何编写一个shell脚本
- 一个批量重命名文件名的shell脚本