我如何理解这部分脚本?调用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