Linux Java Startup scripts

Source: Internet
Author: User

#!/bin/bashexport Lang=en_us. Utf8start () {        ulimit-n 65535        #find the jars        jar_lib= ' ls-1 lib/*.jar '        jar_lib= ' echo $jar _lib | sed ' s//: /g '        #init logs        if [!-d ' logs ']; then  mkdir logs; fi        /usr/local/java-dserver.name=my_server-server -XMX1024M-XMS1024M-XSS160K-XX:NEWRATIO=2-XX:PERMSIZE=128M-XX:MAXPERMSIZE=128M-XX:+USECONCMARKSWEEPGC  -CP Resources:config:${jar_lib}  com.web.Main 1>>logs/stdout 2>>logs/stderr &        pid=$!        echo "$pid" > PID        echo "GameServer1 Process Id: $pid"}stop () {        #pid = ' cat pid '        pid= ' ps aux |grep java |awk ' {if ($12== "-dserver.name=my_server") print $ ""        echo "Stop my_server Process Id: $pid"        kill $pid        Rm-f Pid}case "$" in  start)        stop        start        ;  Stop)        stop        ;;  *)        echo $ "Usage: {start|stop}"        exit 1esac

  

Linux Java Startup scripts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.