Page 1 of 1
kill process based on file name
Posted: Mon Nov 12, 2007 4:15 pm
by ddragas
how to kill process based on file name that runs process. I'm on shared server (cpanel = fantastico)
Posted: Mon Nov 12, 2007 8:11 pm
by feyd
Most hosts running cpanel don't let you kill processes.
What is the actual problem you are trying to solve?
Posted: Tue Nov 13, 2007 4:16 am
by ddragas
Hi Feyd and thank you for reply.
Here is what I need
I'm building system that is submitting certain type of data with some servers, and for that I'm using SMPP protocol (
http://www.smsforum.net/SMPP_v3_4_Issue1_2.zip ), which I have already written (by myself) in php. Now when I connect with server and start to exchange data, everything is fine until I want to disconnect myself from server. In other words I have to connect on server, send data, remain connected for 5 more minutes (in case more data comes) and then disconnect from server.
Until now I've menage to connect and send / receive data from / to server, but I can not disconnect my self from it.
That is why I need to kill process to be able to disconnect myself from server.
All suggestions are appreciated.
Kind regards
ddragas
Posted: Tue Nov 13, 2007 5:47 am
by Kieran Huggins
what it sounds like you want to do is this:
Code: Select all
// remove the script timeout
set_time_limit (0);
// enter your loop
while(1){
// check to see if you're finished
if($task_complete){
// clean up and...
die;
}
// look for input, send output
// set a sleep delay so your script doesn't take over the server
usleep(200);
}
Does that pretty much sum it up?
Posted: Tue Nov 13, 2007 3:29 pm
by ddragas
yes - and this is prity much what am I doing right now, only in the middle of exchanging data id "enquire link" command that keeps connection up.
But I wan't to be able to kill process for any reason. Want to have controll over it. Like STOP button in factory in case of emergency
Is there any way so I can kill process ?
Posted: Tue Nov 13, 2007 6:52 pm
by feyd
Have your script check a value from an external source (like a database.) Then be able to set it from a separate page request.
Posted: Wed Nov 14, 2007 12:08 am
by Kieran Huggins
...and make sure to be nice to your HD and use a HEAP table.
Posted: Wed Nov 14, 2007 2:15 pm
by ddragas
thank you both for reply
You folks always find a good solution on solving things
have a nice day
regards
ddragas