![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
|
|
||||
| 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 07:43 AM |
| root owner of daemons? | xNYx | Security | 1 | 03-12-2002 09:28 AM |
| DNS daemons | Deuce | IP Networking | 8 | 11-29-2001 04:51 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Quote:
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 ! |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
Thanks Tom!
Saludos, Mario. |
|||
| Google The UNIX and Linux Forums |