HELP:Stopping execution of a program
Hello everyone,
I'm trying to stop a daemon process from a another program. The program asks the user if they want to update, if yes the program must get a file (lets call it R1) from a giving location. and then stop the daemon(call it D1) and run R1. R1=D1 but D1 is a newer version. Is there any idea how would I do that?. |
You can just suspend or kill the process, can't you?
|
I tried that using kill(pid_t, SIGSTOP) but I think this only works with the same process and its parent. So I tried to enter the pid manually of the program I'm going to kill, but nothing happens(no errors returned and program still running)
Any Ideas? Do you know if I can send a signal to another program, and if catched, i quit the program? Alaa |
You can make the other program put its pid in a file, then use this program to grab that pid and kill it. What language are you writing this in? What platform?
|
I'm writing this program in C++ linux. This is not the problem; the problem that kill() only kills it itself, parent, or another process in its group (This what i think i got from the manual).
|
All times are GMT -5. The time now is 11:16 PM. |