search_copytools() {
local hosts=${1:-$(facet_active_host $SINGLEAGT)}
- do_nodesv $hosts "libtool execute pgrep -x $HSMTOOL"
+ do_nodesv $hosts "pgrep --pidfile=$HSMTOOL_PID_FILE hsmtool"
}
wait_copytools() {
local fid="$1"
case "$HSMTOOL" in
- lhsmtool_posix)
+ *lhsmtool_posix)
printf "%s" "$(hsm_root)/*/*/*/*/*/*/$fid"
;;
esac
copytool_suspend() {
local agents=${1:-$(facet_active_host $SINGLEAGT)}
- stack_trap \
- "do_nodesv $agents libtool execute pkill -CONT -x '$HSMTOOL' || true" EXIT
- do_nodesv $agents "libtool execute pkill -STOP -x $HSMTOOL" || return 0
+ stack_trap "pkill_copytools $agents CONT || true" EXIT
+ pkill_copytools $agents STOP || return 0
echo "Copytool is suspended on $agents"
}
# Lustre mount-point is mandatory and last parameter on
# copytool cmd-line.
- local mntpnt=$(do_rpc_nodes $agent libtool execute ps -C $HSMTOOL -o args= |
+ local mntpnt=$(do_rpc_nodes $agent \
+ pgrep --pidfile=$HSMTOOL_PID_FILE --list-full hsmtool |
awk '{print $NF}')
[ -n "$mntpnt" ] || error "Found no Agent or with no mount-point "\
"parameter"