Changes

Jump to: navigation, search

Processes scope and visibility

14 bytes added, 12:23, 11 March 2008
VE -> container, CT
# Usage: ./ovzps CTID [ps flags ...]
function find_ve_pidsfind_container_pids(){
local pid
local myveidmyctid=$1 local vepidsctpids=
for pid in $ALLPIDS; do
[ -f /proc/$pid/status ] || continue
veidctid=`grep envID /proc/$pid/status | awk -F: '{print $2}'` if [ ${veidctid} = ${myveidmyctid} ]; then vepidsctpids="$vepids ctpids $pid"
fi
done
echo "$vepidsctpids"
}
ALLPIDS=`ps -A -o pid --no-headers`
VEPIDSCTPIDS=`find_ve_pids find_container_pids $1`
shift
if [ -n "${VEPIDSCTPIDS}" ]; then ps $* -p $VEPIDSCTPIDS
else
exit 0

Navigation menu