2010-10-09 10:12:23| 分类: Linux | 标签: |字号大中小 订阅
版本一,还不知道pgrep命令时:
#!/bin/bash
echo "-->1 kill old process start...,PID="$(ps -ef | grep "jboss-server" | grep "java" | awk '{print $2}')
kill -9 $(ps -ef | grep "jboss-server" | grep "java" | awk '{print $2}')
sleep 2
echo "-->2 kill old process end."
echo "-->3 start app(jboss-server) start..."
cd /vision/jboss-server/bin
nohup ./run.sh -b 10.0.11.170 -Djava.rmi.server.hostname=10.0.11.170 -Dsun.rmi.transport.tcp.connectionPool=true -Dsun.rmi.transport.tcp.maxConnectionThreads=300 > /dev/null 2>&1 &
sleep 60
echo "-->4 start app(jboss-server) end
#!/bin/bash
echo "-->1 kill old process start...,PID="$(ps -ef | grep "jboss-server" | grep "java" | awk '{print $2}')
kill -9 $(ps -ef | grep "jboss-server" | grep "java" | awk '{print $2}')
sleep 2
echo "-->2 kill old process end."
echo "-->3 start app(jboss-server) start..."
cd /vision/jboss-server/bin
nohup ./run.sh -b 10.0.11.170 -Djava.rmi.server.hostname=10.0.11.170 -Dsun.rmi.transport.tcp.connectionPool=true -Dsun.rmi.transport.tcp.maxConnectionThreads=300 > /dev/null 2>&1 &
sleep 60
echo "-->4 start app(jboss-server) end