Permalink
Browse files

fix for service listing on CentOS5

  • Loading branch information...
serghey-rodin committed Oct 14, 2013
1 parent 03727c9 commit c39f0215510938198eb361cdc339a7bc790b2cac
Showing with 3 additions and 1 deletion.
  1. +3 −1 bin/v-list-sys-services
View
@@ -16,6 +16,8 @@ format=${1-shell}
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
export PATH=$PATH:/sbin
get_srv_state() {
srv=$1
proc_name=${2-$1}
@@ -30,7 +32,7 @@ get_srv_state() {
mem=0
for pid in $(pidof $proc_name); do
pid_mem=$(pmap -x $pid | tail -n1 | awk '{print $3}')
pid_cpu=$(grep "^$pid " $tmp_file | cut -f 2 -d ' ')
pid_cpu=$(grep "^$pid " $tmp_file | cut -f 2 -d ' '|sed "s/^0//")
cpu=$((cpu + pid_cpu))
mem=$((mem + pid_mem))
done

0 comments on commit c39f021

Please sign in to comment.