p:
ps -ef | grep my-client.jar | grep -v 'grep'
shutdown.sh
kill -9 `ps -ef | grep 'comp-nm-ivr-client.jar' | grep -v 'grep' |awk '{print $2}'`
start
/opt/aspire/product/my_client/jdk1.7.0_80/bin/java -Xrunjdwp:transport=dt_socket,address=21789,server=y,suspend=n -jar -Djasypt.encryptor.password=my_client my-client.jar >nohup.out & tail -f nohup.out
简化start命令
java -jar comp-nm-ivr-client.jar >> service.log
jboss后台启动process_restart.sh
“`
!/bin/bash
name=whoami
PROID=
(ps−ef|grep
(
p
s
−
e
f
|
g
r
e
p
name|grep ‘7.1.1-jboss’|grep ‘configuration’|grep ‘-XX’|awk ‘{print
2"\t"
2
"
\t
"
3}’)
BIN=/opt/aspire/product/ppsnm/7.1.1-jboss/bin
PTH=/opt/aspire/product/ppsnm/7.1.1-jboss/standalone/
DISK_C=
(df|grep′opt′|awk′print$4′)DISKC1=
(
d
f
|
g
r
e
p
′
o
p
t
′
|
a
w
k
′
p
r
i
n
t
$
4
′
)
D
I
S
K
C
1
=
{DISK_C%%%}
if [ “$DISK_C1” -gt “98” ] ;then
echo “the free_disk is too small,which will effect you restart process!!”
exit 1
fi
cd
BINsleep1;if[−z“
B
I
N
s
l
e
e
p
1
;
i
f
[
−
z
“
PROID” ];then
sh /opt/aspire/product/ppsnm/7.1.1-jboss/bin/start
else
PROID=
(echo"
(
e
c
h
o
"
PROID”)
kill -9
PROIDcd
P
R
O
I
D
c
d
PTH
rm -rf data/ tmp/
cd $BIN
sh /opt/aspire/product/ppsnm/7.1.1-jboss/bin/start
fi
···