> I'd think that the pgrep is matching both the processes you want
> to kill _and_ the init.d script itself.
My script looks like the following:
restart)
echo "Stopping my_app:"
pgrep my_app | while read PIDS
do
if [ "$PIDS" -eq $$ ]; then
continue
fi
kill -9 $PIDS
done
echo "Starting my_app:"
/etc/init.d/my_app start &
exit $?
;;
Thanks for the help everyone its greatly appreciated.
Regards,
James ;)
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GIT/MU/U dpu s: a--> C++>$ U+> L++> B-> P+> E?> W+++>$ N K W++ O M++>$ V-
PS+++ PE++ Y+ PGP t 5 X+ R- tv+ b+> DI D+++ G+ e(+++++) h--(++) r++ z++
------END GEEK CODE BLOCK------
_______________________________________________ CentOS mailing list CentOS@xxxxxxxxxx http://lists.centos.org/mailman/listinfo/centos