锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
#date:2015-01-29
#author:zhangtao
#desc:stop the service by given service-name
######################################################
SERVICE_NAME=imgate
WATCHDOG_NAME=startimgate.sh
#######################################
function stopService()
{
PROCESS_NAME=$1
PIDS=`ps axu | grep $PROCESS_NAME | grep -v "grep" | awk '{print $2}'`
PIDNUM=0
for PID in $PIDS
do
echo "IsKilled : $PROCESS_NAME : $PID"
kill -9 $PID
let PIDNUM=$PIDNUM+1
done
if [ $PIDNUM == 0 ] ;then
echo "NotFound : $PROCESS_NAME"
else
echo "FoundNum : $PROCESS_NAME : $PIDNUM"
fi
echo "-------"
return
}
####################################
function printPrompt()
{
read -p ">>>:you must input 'yes' to continue:" choice
[ "$choice" != "yes" ] && echo ">>>: not yes,so exit" && exit 0
echo ">>>:yes,continue"
}
#####################################
function main()
{
printPrompt
#set -x
echo ""
PROCESS_ARRAY=($WATCHDOG_NAME $SERVICE_NAME)
echo "length of process_array :${#PROCESS_ARRAY[@]}"
echo "============"
for PROCESS in ${PROCESS_ARRAY[@]};
do
stopService $PROCESS
done
echo "---->finished"
}
main
]]>
]]>
]]>
緙栬瘧Linux c++浠g爜鐨勫嚑涓棶棰?br />
1.c++欏圭洰縐繪鍒頒笉鍚岀増鏈殑linux騫沖彴錛岄渶瑕侀噸鏂扮紪璇戜竴嬈°傚彲鑳藉茍涓嶈兘欏哄埄鍦扮紪璇戦氳繃錛?br /> 闂鍙兘鍑虹幇錛歡cc緙栬瘧鍣ㄧ殑鐗堟湰錛岃緝楂樼増鐨勶紝瀵硅娉曠殑媯(gè)鏌ユ洿鍔犵殑涓ユ牸錛岄亣鍒扮殑闂鏄紝
include鏂囦歡鐨勪緷璧栵紝template璇硶鐨勫0鏄庯紝鎵渚濊禆鐨勭郴緇熷簱鐨勭己澶憋紝鍦?4浣嶇郴緇熶笅緙栬瘧
32浣嶇▼搴忕瓑絳夈?br />
2./usr/bin/ld: cannot find -lstdc++ 瑙e喅
sudo yum search "static" |grep "\(libc\|stdc\+\+\)"
灝嗘悳绱㈠埌鍒板寘錛屽畨瑁呬笂灝辮浜?jiǎn)銆?/p>
3.x86_64 Linux Error: gnu/stub-32.h
Fix for the RHEL/CentOS 5.x for GCC gnu/stub-32.h missing error
Type the following yum command:
# yum -y install glibc-devel.i386
Fix for the RHEL/CentOS 6.x for GCC gnu/stub-32.h missing error
Type the following yum command:
# yum -y install glibc-devel.i686 glibc-devel
璇風(fēng)儲(chǔ)寮曞府鍔╂枃妗o細(xì)
http://www.cyberciti.biz/faq/x86_64-linux-error-gnustub-32h-missing-error-and-solution/
4. uuid/uuid.h 鎵句笉鍒?/p>
yum -y install libuuid-devel