blob: 3aca0bc68d376ae225cc6860a925ad7307f2e10f [file] [log] [blame]
#!/bin/sh
#*******************************************************************************
# Copyright (c) 2010, 2019 IBM Corporation and others.
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# IBM Corporation - initial API and implementation
#*******************************************************************************
echo;
PID=$1
if [ ! -z $PID ] ; then
# I've found lsof is in /user/sbin on some machines
nhandles=`/usr/bin/lsof -p $PID | wc -l`
echo " process PID: " $PID
echo " Number of handles in process: $nhandles"
else
PID=`pgrep -f configure=/opt/users/hudsonbuild/`
if [ ! -z $PID ] ; then
nhandles=`/usr/bin/lsof -p $PID | wc -l`
echo " hudson process PID: " $PID
echo " Number of handles in process: $nhandles"
else
echo " PID $PID not found/defined (maybe pass in as first argument)?."
fi
fi
echo