2005-03-20 12:38:08 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
base=`basename $0`
|
|
|
|
|
|
|
|
echo "1..1"
|
|
|
|
|
|
|
|
name="pgrep -F <pidfile>"
|
2014-03-19 12:46:04 +00:00
|
|
|
pidfile=$(pwd)/pidfile.txt
|
|
|
|
sleep=$(pwd)/sleep.txt
|
2005-03-20 12:38:08 +00:00
|
|
|
ln -sf /bin/sleep $sleep
|
2005-08-25 20:11:39 +00:00
|
|
|
$sleep 5 &
|
2005-03-20 12:38:08 +00:00
|
|
|
sleep 0.3
|
2005-08-25 20:11:39 +00:00
|
|
|
chpid=$!
|
|
|
|
echo $chpid > $pidfile
|
2005-03-20 12:38:08 +00:00
|
|
|
pid=`pgrep -f -F $pidfile $sleep`
|
|
|
|
if [ "$pid" = "$chpid" ]; then
|
|
|
|
echo "ok - $name"
|
|
|
|
else
|
|
|
|
echo "not ok - $name"
|
|
|
|
fi
|
2005-08-24 19:39:29 +00:00
|
|
|
kill "$chpid"
|
2005-03-20 12:38:08 +00:00
|
|
|
rm -f $pidfile
|
|
|
|
rm -f $sleep
|