LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-10-2006, 04:44 PM   #1
allomeen
Member
 
Registered: Dec 2005
Posts: 83

Rep: Reputation: 15
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?.
 
Old 03-10-2006, 06:25 PM   #2
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
You can just suspend or kill the process, can't you?
 
Old 03-10-2006, 06:36 PM   #3
allomeen
Member
 
Registered: Dec 2005
Posts: 83

Original Poster
Rep: Reputation: 15
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
 
Old 03-10-2006, 06:38 PM   #4
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
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?
 
Old 03-10-2006, 06:42 PM   #5
allomeen
Member
 
Registered: Dec 2005
Posts: 83

Original Poster
Rep: Reputation: 15
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).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
execution of one program inside of another microsoft/linux Programming 2 03-18-2005 10:24 AM
Key bindings program (custom pasting, program execution, etc.) jrdioko Linux - Software 2 02-05-2005 09:09 PM
program execution at startup DeeDub Linux - Software 2 09-11-2003 01:25 PM
program execution monitoring imp Linux - General 1 05-26-2002 09:22 AM
Stopping before the Execution of the startup files !! sachin77 Linux - Newbie 0 04-25-2001 03:23 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration