RE: [PHP] PID needed to hammer squid
| From: | Jay Blanchard | Date: | Wed, 25 Aug 2004 16:00:14 +0000 |
| Subject: | RE: [PHP] PID needed to hammer squid | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-194690@lists.php.net to get a copy of this message | ||
[snip]
I need to restart squid from PHP, but my squi doesn't stop because a lot
of stupid errors.
So, i need to kill it and then start it again.
[root@nau init.d]# ps aux | grep squid
root 9281 0.0 0.3 6124 1792 ? S 16:04 0:00 squid -D
squid 9283 0.0 1.0 8392 5060 ? S 16:04 0:00 (squid) -D
squid 9284 0.0 0.0 1360 264 ? S 16:04 0:00 (unlinkd)
root 9288 0.0 0.1 3860 592 pts/0 S 16:10 0:00 grep squid
[root@nau init.d]# echo $$;
The pid i need to kill is the one from the line:
squid 9283 0.0 1.0 8392 5060 ? S 16:04 0:00 (squid) -D
How can i get this pid so i can kill -9 it and then start squid again ?
[/snip]
Start here http://www.php.net/exec
To get the PID you may be able to place the output of ps -aux in an array, regex for what you want,
then exec