The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Starting daemons at reboot. shorty UNIX for Dummies Questions & Answers 2 04-03-2007 11:10 AM
SUN SOLARIS boot: start daemons ctap SUN Solaris 1 07-14-2005 05:07 AM
Daemons Pennywize UNIX for Dummies Questions & Answers 6 02-21-2003 06:43 AM
root owner of daemons? xNYx Security 1 03-12-2002 08:28 AM
DNS daemons Deuce IP Networking 8 11-29-2001 03:51 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-07-2005
Registered User
 

Join Date: Jun 2005
Posts: 3
Stumble this Post!
A doubt on Daemons

Hi there!

I'm a bit curious on something about Daemons....

Supose you have two processes say A and B, where B is a daemon.
A is totally independent from B.

Is there a way for A to find out B's return code?
Is there a way for A to find out when B ends?

Thanks!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-11-2005
Sergiu-IT's Avatar
Registered User
 

Join Date: Mar 2005
Location: Transilvania
Posts: 125
Stumble this Post!
Quote:
Originally Posted by marioh
Is there a way for A to find out B's return code?
Is there a way for A to find out when B ends?
Hi, there !
For the first question, I'm not sure... probably if you start it from a shell script or if you start it manualy, you can check the $? variable ( echo $? ).
For the second question, if A is a script shell or something like this, you can try this : ps aux | grep B_daemon_name. After this, like on the first question, check the $? variable. If it's value is 0, then everything is ok. If the value is 1 or something else, there was an error or your daemon is death
I hope this helped.
Good luck !
Reply With Quote
  #3 (permalink)  
Old 06-14-2005
Registered User
 

Join Date: Jun 2005
Posts: 3
Stumble this Post!
Thank you for your reply, but I was thinking of some kind of operating system function callable from a programming language interface, say C or Python.

Saludos,
Mario.
Reply With Quote
  #4 (permalink)  
Old 06-14-2005
Registered User
 

Join Date: May 2005
Posts: 40
Stumble this Post!
Assuming both A and B are user processes (vs kernel process), as far as I know (I could be wrong), there is no way for A to catch exit status code of B. Exit status is returned to parent process only. In this scenario, the parent of daemon B is init. That means only the sceduler init would know the exit status of B.

Similar principle applies to the second question about ending time of daemon B. However, most of daemon logs its termination to syslog file via syslog daemon. That is where A might check to find out the ending time of B.
Tom
Reply With Quote
  #5 (permalink)  
Old 06-21-2005
Registered User
 

Join Date: Jun 2005
Posts: 3
Stumble this Post!
Thanks Tom!
Saludos,
Mario.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:46 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0