| #!/bin/sh | |
| 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 |