common.check (pcp-6.0.2) | : | common.check (pcp-6.0.3) | ||
---|---|---|---|---|
skipping to change at line 979 | skipping to change at line 979 | |||
{ | { | |||
#debug# set -x | #debug# set -x | |||
if [ -z "$1" ] | if [ -z "$1" ] | |||
then | then | |||
echo "Usage botch: _wait_pmlogger_end() needs pid arg" | echo "Usage botch: _wait_pmlogger_end() needs pid arg" | |||
status=0 | status=0 | |||
exit $status | exit $status | |||
fi | fi | |||
__pid=$1 | __pid=$1 | |||
if sudo kill -s 0 $__pid 2>/dev/null | if $sudo kill -s 0 $__pid 2>/dev/null | |||
then | then | |||
# pmlogger process exists, so wait for PID file to go away | # pmlogger process exists, so wait for PID file to go away | |||
# | # | |||
echo "pmlogger process $__pid present ..." >>$here/$seq.full | echo "pmlogger process $__pid present ..." >>$here/$seq.full | |||
$PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep -E "[P]ID|[p]mlogger|$__pid" >>$her e/$seq.full | $PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep -E "[P]ID|[p]mlogger|$__pid" >>$her e/$seq.full | |||
else | else | |||
# pmlogger process is not here, warn if PID file is here, | # pmlogger process is not here, warn if PID file is here, | |||
# and we're done | # and we're done | |||
if [ -f "$PCP_TMP_DIR/pmlogger/$__pid" ] | if [ -f "$PCP_TMP_DIR/pmlogger/$__pid" ] | |||
then | then | |||
skipping to change at line 1022 | skipping to change at line 1022 | |||
else | else | |||
# now there is an ugly race condition at the end of pmlogger | # now there is an ugly race condition at the end of pmlogger | |||
# ... once the control file has been removed (as per the test | # ... once the control file has been removed (as per the test | |||
# above) the pmlogger log file is not complete until the atexit() | # above) the pmlogger log file is not complete until the atexit() | |||
# code is run ... so hang around waiting for the process to | # code is run ... so hang around waiting for the process to | |||
# go away | # go away | |||
# | # | |||
__i=0 | __i=0 | |||
while true | while true | |||
do | do | |||
if sudo kill -s 0 $__pid 2>/dev/null | if $sudo kill -s 0 $__pid 2>/dev/null | |||
then | then | |||
# process still exists | # process still exists | |||
__i=`expr $__i + 1` | __i=`expr $__i + 1` | |||
if [ "$__i" -ge 100 ] | if [ "$__i" -ge 100 ] | |||
then | then | |||
# may exist, but is defunct so we should treat this | # may exist, but is defunct so we should treat this | |||
# as "ended" ... | # as "ended" ... | |||
# | # | |||
$PCP_PS_PROG $PCP_PS_ALL_FLAGS \ | $PCP_PS_PROG $PCP_PS_ALL_FLAGS \ | |||
| $PCP_AWK_PROG >$tmp.pmlogger.defunct ' | | $PCP_AWK_PROG >$tmp.pmlogger.defunct ' | |||
skipping to change at line 1089 | skipping to change at line 1089 | |||
fi | fi | |||
if [ -z "$__pid" ] | if [ -z "$__pid" ] | |||
then | then | |||
#debug# set +x | #debug# set +x | |||
return | return | |||
fi | fi | |||
__i=0 | __i=0 | |||
while true | while true | |||
do | do | |||
if sudo kill -s 0 $__pid 2>/dev/null | if $sudo kill -s 0 $__pid 2>/dev/null | |||
then | then | |||
# process still exists | # process still exists | |||
__i=`expr $__i + 1` | __i=`expr $__i + 1` | |||
if [ "$__i" -ge 100 ] | if [ "$__i" -ge 100 ] | |||
then | then | |||
echo "_wait_pmcd_end: failed to see pid $__pid exit after 100 ite rations" | echo "_wait_pmcd_end: failed to see pid $__pid exit after 100 ite rations" | |||
_systemctl_status pmcd | _systemctl_status pmcd | |||
#debug# set +x | #debug# set +x | |||
return | return | |||
fi | fi | |||
skipping to change at line 1170 | skipping to change at line 1170 | |||
#debug# set +x | #debug# set +x | |||
return | return | |||
fi | fi | |||
__i=0 | __i=0 | |||
while true | while true | |||
do | do | |||
rm -f $tmp.some_pmie_running | rm -f $tmp.some_pmie_running | |||
for __pid in $__pidlist | for __pid in $__pidlist | |||
do | do | |||
if sudo kill -s 0 $__pid 2>/dev/null | if $sudo kill -s 0 $__pid 2>/dev/null | |||
then | then | |||
# process still exists | # process still exists | |||
touch $tmp.some.pmie | touch $tmp.some.pmie | |||
fi | fi | |||
done | done | |||
if [ -f $tmp.some.pmie ] | if [ -f $tmp.some.pmie ] | |||
then | then | |||
__i=`expr $__i + 1` | __i=`expr $__i + 1` | |||
if [ "$__i" -ge 100 ] | if [ "$__i" -ge 100 ] | |||
then | then | |||
skipping to change at line 1288 | skipping to change at line 1288 | |||
echo _wait_for_pmproxy_logfile failed after 20 iterations | echo _wait_for_pmproxy_logfile failed after 20 iterations | |||
return 1 | return 1 | |||
} | } | |||
# Wait for pmproxy to end | # Wait for pmproxy to end | |||
# | # | |||
_wait_pmproxy_end() | _wait_pmproxy_end() | |||
{ | { | |||
#debug# set -x | #debug# set -x | |||
__pid=`cat $PCP_RUN_DIR/pmroxy.pid 2>/dev/null` | __pid=`cat $PCP_RUN_DIR/pmproxy.pid 2>/dev/null` | |||
if [ -z "$__pid" ] | if [ -z "$__pid" ] | |||
then | then | |||
# no $PCP_RUN_DIR/proxy.pid file, try ps(1) the hard way | # no $PCP_RUN_DIR/proxy.pid file, try ps(1) the hard way | |||
# | # | |||
__pid=`$PCP_PS_PROG $PCP_PS_ALL_FLAGS \ | __pid=`$PCP_PS_PROG $PCP_PS_ALL_FLAGS \ | |||
| sed -n -e '/\[p]mproxy /{ | | sed -n -e '/\[p]mproxy /{ | |||
s/^[^ ]*// | s/^[^ ]*// | |||
s/^[ ]*// | s/^[ ]*// | |||
s/[ ].*// | s/[ ].*// | |||
p | p | |||
skipping to change at line 1310 | skipping to change at line 1310 | |||
fi | fi | |||
if [ -z "$__pid" ] | if [ -z "$__pid" ] | |||
then | then | |||
#debug# set +x | #debug# set +x | |||
return | return | |||
fi | fi | |||
__i=0 | __i=0 | |||
while true | while true | |||
do | do | |||
if sudo kill -s 0 $__pid 2>/dev/null | if $sudo kill -s 0 $__pid 2>/dev/null | |||
then | then | |||
# process still exists | # process still exists | |||
__i=`expr $__i + 1` | __i=`expr $__i + 1` | |||
if [ "$__i" -ge 100 ] | if [ "$__i" -ge 100 ] | |||
then | then | |||
echo "_wait_proxy_end: failed to see pid $__pid exit after 100 it erations" | echo "_wait_proxy_end: failed to see pid $__pid exit after 100 it erations" | |||
_systemctl_status proxy | _systemctl_status proxy | |||
#debug# set +x | #debug# set +x | |||
return | return | |||
fi | fi | |||
skipping to change at line 2558 | skipping to change at line 2558 | |||
__req_state=NO | __req_state=NO | |||
else | else | |||
echo "_change_config: Error: bad state ($2) should be on or off" | echo "_change_config: Error: bad state ($2) should be on or off" | |||
status=0 | status=0 | |||
exit $status | exit $status | |||
fi | fi | |||
if [ "$__state" != "$__req_state" ] | if [ "$__state" != "$__req_state" ] | |||
then | then | |||
sed </etc/hostconfig >$tmp._state \ | sed </etc/hostconfig >$tmp._state \ | |||
-e "/^$__pat=/s/-.*/-$__req_state-/" | -e "/^$__pat=/s/-.*/-$__req_state-/" | |||
sudo cp $tmp._state /etc/hostconfig | $sudo cp $tmp._state /etc/hostconfig | |||
fi | fi | |||
fi | fi | |||
elif [ $PCP_PLATFORM = freebsd ] | elif [ $PCP_PLATFORM = freebsd ] | |||
then | then | |||
# no control for FreeBSD | # no control for FreeBSD | |||
: | : | |||
elif [ $PCP_PLATFORM = netbsd ] | elif [ $PCP_PLATFORM = netbsd ] | |||
then | then | |||
# no control for NetBSD | # no control for NetBSD | |||
: | : | |||
End of changes. 7 change blocks. | ||||
7 lines changed or deleted | 7 lines changed or added |