Re: killing linux process with CGI
by moritz (Cardinal) on Oct 15, 2007 at 13:13 UTC
|
If you don't do some serious configuration magic, the script is run as the www or www-data user by apache, not as the owner of the script.
Which explains why you don't have the permission to kill scripts other than those with user www(-data).
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
scriped is owned by www-data, and process running also by www-data
| [reply] [Watch: Dir/Any] |
Re: killing linux process with CGI
by northwind (Hermit) on Oct 15, 2007 at 14:42 UTC
|
| [reply] [Watch: Dir/Any] |
Re: killing linux process with CGI
by lorn (Monk) on Oct 15, 2007 at 13:43 UTC
|
You can run apache with root, but need to compile with -DBIG_SECURITY_HOLE :)
If you really need that, you can use a database cgi application, and then run a cron every 5 minutes that read the database and kill the process, and that cron run as root
i'm not recommend anything, you cannot fix the problem, instead of kill the process?
UPDATE: Users explain more thing, while i was writing this, please disregard
| [reply] [Watch: Dir/Any] |
Re: killing linux process with CGI
by zentara (Archbishop) on Oct 15, 2007 at 14:25 UTC
|
Just an idea that may not be suitable in your particular case.
Investigate su and sudo. I have no idea how your server is setup, it can be complicated or impossible. Google and groups.google search for "sudo cgi" etc. Usually you need suexec running, so that cgi scripts get run as the user of the homedir. Sudo is usually preferred nowadays, since it is more restrictive(safer), where you specify what can be run , and by who, in a sudoers configuration file ( usually /etc/sudoers)
| [reply] [Watch: Dir/Any] |
|
im using sudo, good tip to use it here ;)
| [reply] [Watch: Dir/Any] |
Re: killing linux process with CGI
by blue_cowdawg (Monsignor) on Oct 15, 2007 at 16:35 UTC
|
First off you should never be sending a signal 9 to a process unless prior attempts with other signals have falled (as has been pointed out to you in this thread) and secondly the parameter you need to send should have been a positive integer not a negative one. See kill.
When you are passing the signal number from the shell the "-" signifies an optional parementer is being passed, not the signedness of the number of the signal.
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
| [reply] [Watch: Dir/Any] |
Re: killing linux process with CGI
by tinita (Parson) on Oct 16, 2007 at 08:19 UTC
|
additionally to the other comments about kill -9:
kill -9,@pid;
you should check the return value and the error message.
why don't you want to know why it failed?
kill -9, @pid or die "Could not kill: $!";
| [reply] [Watch: Dir/Any] [d/l] [select] |
Re: killing linux process with CGI
by ultibuzz (Monk) on Oct 15, 2007 at 14:08 UTC
|
both nummers are equal and the number of www-data.
i thought of that i setup a sock listener on linux and send a signal through cgi to the listner, just found it in cookbook,server/client.
update: sending signal via cgi to listner is working and process get killed. thx alot for the helpfull hints, liek the db thingy and the user variables(neverheared of them befor :) ) kd ultibuzz
| [reply] [Watch: Dir/Any] |
Re: killing linux process with CGI
by ultibuzz (Monk) on Oct 16, 2007 at 07:06 UTC
|
thx for the hint with the kill 1,2 etc, tbh i didn't know thats bad to kill with 9 thx to point out the - thing
kd ultibuzz | [reply] [Watch: Dir/Any] |