【发布时间】:2013-08-10 11:08:15
【问题描述】:
如何理解这部分脚本?调用 ps h -fwC ifmFuseHandler 会给出以下输出:
DRBimg:/tmp # ps h -fwC ifmFuseHandler
insite1 29149 1 0 11:57 ? Ssl 0:00 ifmFuseHandler -o allow_other /opt/insiteone/fuse-mount
我对 ifmFuseHandler 在什么条件下启动特别感兴趣?
这是完整的脚本(一些摘录形式):
# START IFM
if [ $MYTYPE = "ifmFuseHandler" -o $MYTYPE = "ALL" ]
then
# IF A PROXY
if [ $PROXY -eq 0 -a $DOIFM -eq 1 ]
then
# Make sure the fuse module is loaded
FUSE=`lsmod | grep fuse`
ret=$?
if [ $ret -ne 0 ]
then
/sbin/modprobe fuse 2>/dev/null
fi
FOUND=1
#PID=`df | awk '/ifmFuseHandler/ {print $1}'`
#PID=`ps -ef | grep -v 'awk' | awk '/ifmFuseHandler/ { print$2 }'`
PID=`ps h -fwC ifmFuseHandler | awk '/ifmFuseHandler/ { print$2 }'`
if [ "x$PID" = x ]; then
msg "Starting ifmFuseHandler..." $MSG_ALL
su - $USER -c "cd $DIR_INDEX;ifmFuseHandler $IFM_SINGLE_THREAD -o allow_other $IFM_MOUNT"
else
msg "ifmFuseHandler already running! PID=$PID" $MSG_ALL
fi
fi
fi
【问题讨论】:
-
可执行文件的位置没有任何意义 -
ps告诉你process status- 我发现man ps会回答你的所有问题。 -
不,它没有。我知道 ps 做了什么,但不确定 ifmFuseHandler 是如何启动的,以及它的参数是什么。
-
在这两者之间,我编辑了我的问题。
标签: linux shell process command