Skip to content

Commit c39f021

Browse files
committed
fix for service listing on CentOS5
1 parent 03727c9 commit c39f021

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/v-list-sys-services

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ format=${1-shell}
1616
source $VESTA/func/main.sh
1717
source $VESTA/conf/vesta.conf
1818

19+
export PATH=$PATH:/sbin
20+
1921
get_srv_state() {
2022
srv=$1
2123
proc_name=${2-$1}
@@ -30,7 +32,7 @@ get_srv_state() {
3032
mem=0
3133
for pid in $(pidof $proc_name); do
3234
pid_mem=$(pmap -x $pid | tail -n1 | awk '{print $3}')
33-
pid_cpu=$(grep "^$pid " $tmp_file | cut -f 2 -d ' ')
35+
pid_cpu=$(grep "^$pid " $tmp_file | cut -f 2 -d ' '|sed "s/^0//")
3436
cpu=$((cpu + pid_cpu))
3537
mem=$((mem + pid_mem))
3638
done

0 commit comments

Comments
 (0)