A doubt on Daemons


 
Thread Tools Search this Thread
Operating Systems Linux A doubt on Daemons
# 1  
Old 06-07-2005
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!
# 2  
Old 06-11-2005
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 Smilie
I hope this helped.
Good luck !
# 3  
Old 06-14-2005
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. Smilie

Saludos,
Mario.
# 4  
Old 06-15-2005
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  
Old 06-21-2005
Thanks Tom!
Saludos,
Mario.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Command to list down all daemons in Solaris

Hi All, Is there any command to list all running daemons in Solaris. I should able to see only running daemons. Regards, SKumar (5 Replies)
Discussion started by: nskumar
5 Replies

2. HP-UX

status of daemons

Hi there all, Hey, is there a way to get the status of all daemons running on a HPUX? in an easy way? Like the same way how to vieuw the status of packages in cmviewcl. Thanks! (1 Reply)
Discussion started by: draco
1 Replies

3. Shell Programming and Scripting

daemons definition

hi there, can somebody give me a definition for daemons, or example what are they !! and what the use for? i've done some research and all what i found is /etc/... or /usr/bin/... and i haven't quietly got the concept. any ideas !! Thanks. (5 Replies)
Discussion started by: new2Linux
5 Replies

4. Shell Programming and Scripting

piping and backgroud processes (daemons)

Hello to all, I've a strage problem here: a perl script that parses the output of sar -q 300 0 (one line of performace data each 5 min. infinately) works fine from the CLI. It processes one line output every 5 minutes. If i disconnect it from the terminal (executing it with cron, nohup startporc... (2 Replies)
Discussion started by: demwz
2 Replies

5. UNIX for Dummies Questions & Answers

Starting daemons at reboot.

I rebooted my server (solaris 5.8) and I had to manually start the cron and mailx daemons. How do I get these to automatically start at reboot? Thanks in advance. (2 Replies)
Discussion started by: shorty
2 Replies

6. Solaris

SUN SOLARIS boot: start daemons

Hi, I have a problem on a Solaris 9 server! After a restart some daemons don't start and I have to start them manually! I thing that everything is ok in the /sbin/rc3 script! And if I run manually the "/etc/init.d/xxx start" the services start without problem. I didn't find anything in... (1 Reply)
Discussion started by: ctap
1 Replies

7. UNIX for Dummies Questions & Answers

Daemons

MYSQL-daemon don't started automatically by system-start. And same trouble with httpd too. I have SuSE 8.0. What can I do ? Thanks.... (6 Replies)
Discussion started by: Pennywize
6 Replies

8. Cybersecurity

root owner of daemons?

Hi all, what happens if i have a service running as root? if it is exploited what would happen? can a hacker actually becomes a hacker and screw up my whole box? thanks (1 Reply)
Discussion started by: xNYx
1 Replies

9. IP Networking

DNS daemons

Does anyone know the command to start the DNS Daemon. I looked in the /etc/init.d/inetsvc file and it tells me what the text should look like. When I go to open the corresponding files they are encoded and I can't read them. So is there a command that will start the DNS daemon? If... (8 Replies)
Discussion started by: Deuce
8 Replies
Login or Register to Ask a Question