- 论坛徽章:
- 0
|
用ps -ef|grep x,可查看 到如下进程,
telebase 21533 1 0 04:27:00 ? 00:00:00 hostcli.x s80 9777
telebase 21536 1 0 04:27:00 ? 00:00:00 fax_ps.x
telebase 21537 21536 0 04:27:00 ? 00:00:00 fax_ps.x
telebase 21540 1 0 04:27:00 ? 00:00:00 fax_ps.x
telebase 21541 21540 0 04:27:00 ? 00:00:00 fax_ps.x
telebase 21922 21899 0 09:32:16 ttyp1 00:00:01 newcli_r3.x 1
可newcli_r3.x 1进程老是掉,本人编了个小脚本a,3秒检查一下newcli_r3.x进程掉,发现掉就重启。如下:
cd /usr/telebase/qym
a=1
while [ $a -eq 1 ]
do
ps -ef|grep x|awk '{print $8}'|grep newcli_r3.x
if [ $? -eq 1 ]
then
cd /usr/telebase/new/exe
newcli_r3.x 1
fi
sleep 3
done
可以运行。可检测时,我杀了子进程,即kill -9 21922,过3秒,newcli_r3.x 1可自动重启。若我kill -9 21922 21899 ,则newcli_r3.x 1
不会自动重启,而且此脚本a也好像被杀出来了。
请问高手,本人哪儿出错了??? |
|