由于jabberd2没有提供停止的脚本,所以,想要关闭时,必须手工的一个个的去kill掉,很不方便。针对这种情况,我写了一个简单的脚本来停止jabberd2服务器。
#!/bin/bash
#run jabberd server
run_home=/home/shibo/usr/local/jabberd/jabberd2/
mysql_home=/home/shibo/usr/local/mysql_5.6.23/lib
while [ "$(ps -aux | grep "jabberd" | grep -vE '(grep|_run_jabberd)')" != "" ]
do
echo $(ps -aux | grep jabberd | grep -vE '(grep|_run_jabberd)') | awk '{print $2}' | xargs kill -TERM
done
echo $(ps -aux | grep jabberd | grep -vE '(grep|_run_jabberd)')
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${mysql_home}
cd ${run_home}/bin
./jabberd -D