--- /usr/tmp/TmpDir.29411-0/src/pmie/pmie_check.sh_1.5 Mon Dec 3 13:23:30 2001 +++ src/pmie/pmie_check.sh Mon Dec 3 10:25:08 2001 @@ -3,7 +3,7 @@ # # Copyright (c) 1998-2000, Silicon Graphics, Inc. All Rights Reserved # -# $Id: pmie_check.sh,v 1.5 2001/06/04 04:32:10 kenmcd Exp $ +# $Id: pmie_check.sh,v 1.4 2001/03/20 02:04:52 markgw Exp $ # # Administrative script to check pmie processes are alive, and restart # them as required. @@ -14,6 +14,22 @@ PMIE=pmie +# added to handle problem when /var/log/pcp is a symlink, as first +# reported by Micah_Altman@xxxxxxxxxxx in Nov 2001 +# +_unsymlink_path() +{ + [ -z "$1" ] && return + __d=`dirname $1` + __real_d=`cd $__d 2>/dev/null && /bin/pwd` + if [ -z "$__real_d" ] + then + echo $1 + else + echo $__real_d/`basename $1` + fi +} + have_pmieconf=false if which pmieconf >/dev/null 2>&1 then @@ -347,6 +363,7 @@ -e "s;PCP_LOG_DIR;$PCP_LOG_DIR;g" \ | while read host socks logfile args do + logfile=`_unsymlink_path $logfile` line=`expr $line + 1` case "$host" in @@ -445,6 +462,7 @@ NR == 2 { printf "p_logfile=\"%s\"\n", $0; next } NR == 3 { printf "p_pmcd_host=\"%s\"\n", $0; next } { next }'` + p_logfile=`_unsymlink_path $p_logfile` if [ "$p_logfile" = $logfile -a "$p_pmcd_host" = "$fqdn" ] then pid=$p_id