| Dave (from the UK) 2006-05-30, 1:16 pm |
| Consider this:
A CPU intensive application is started from a browser. Under some
circumstances this can get out of hand and it is useful the person who
stared it to be able to kill it.
The following web page has a 'kill' button, which executes
http://witm.sourceforge.net/witm.php
pkill -u nobody MathKernel ; sleep 1; pkill -u nobody -9 MathKernel
The problem is, that will kill any MathKernel process running that was
stared by the web server, not just that stared by the person who presses
the kill button.
I was thinking of something along the lines of
1) Add 1000 users, with UIDs in the range A <= uid <= A+999.
2) Convert IP address to a number in the range A to A+ 999.
3) Use suexec to start the process with a unique UID (okay, there are
only 1000 UIDs and lots of IPs, but it would work on low-traffic servers).
User can only kill processes with the uid his IP maps to.
I suspect there is another (probably better) solution, but I've not
really got a clue.
--
Dave K MCSE.
MCSE = Minefield Consultant and Solitaire Expert.
Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually.
http://witm.sourceforge.net/ (Web based Mathematica frontend)
|