Path: blob/main/bin/pkill/tests/pkill-_lf_test.sh
104653 views
#!/bin/sh12base=`basename $0`34echo "1..2"56name="pkill -LF <pidfile>"7pidfile=$(pwd)/pidfile.txt8sleep=$(pwd)/sleep.txt9ln -sf /bin/sleep $sleep10daemon -p $pidfile $sleep 511sleep 0.312pkill -f -L -F $pidfile $sleep13ec=$?14case $ec in150)16echo "ok 1 - $name"17;;18*)19echo "not ok 1 - $name"20;;21esac2223# Be sure we cannot kill process which pidfile is not locked.24$sleep 5 &25sleep 0.326chpid=$!27echo $chpid > $pidfile28pkill -f -L -F $pidfile $sleep 2>/dev/null29ec=$?30case $ec in310)32echo "not ok 2 - $name"33;;34*)35echo "ok 2 - $name"36;;37esac3839kill "$chpid"40rm -f $pidfile41rm -f $sleep424344