- echo "Current DIR is " $PWD
- # ignore signal hup int quit tstp
- trap "" 1 2 3 24
- start_server() {
- ulimit -c unlimited
- # nohup java -jar LF_S_SignalProc.jar -Dfile.encoding=UTF-8 >> ist.log &
- java -jar LF_S_SignalProcDemo.jar -Dfile.encoding=UTF-8 >> ist.log & echo $! > java.pid
- #-Dfile.encoding java -jar -Dfile.encoding=UTF-8 LF_S_SignalProc.jar >> ist.log=UTF-8
- }
- kill_server() {
- # ps -aux | grep java | grep -v grep | awk {'print $2'} | xargs kill -2
- pid=$(cat java.pid )
- kill -9 $pid
- }
- while [ 1 ]
- do
- propserverpid=`ps -ef | grep java | grep -v grep |awk '{print $2}'`
- ${now}${propserverpid} >> pid.log
- if [ ! "$propserverpid" ]
- then
- echo "propserver is down, now starting ..."
- start_server
- fi
- sleep 1
- done