bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unix daemon (was: Hi ..)


From: Bob Proulx
Subject: unix daemon (was: Hi ..)
Date: Thu, 1 Sep 2005 23:49:00 -0600
User-agent: Mutt/1.5.9i

Satpathy, Ajay (Corporate,  consultant) wrote:
> We use nohup command in Linux environment to start a process in back 
> ground. This process must run continuously until the process is killed. We 
> notice that the process is running fine for some time and then stops 
> automatically on its own. We have no clue how the process is stopped.

We don't have a clue as to why your program is exiting either.

> Is there any way to know why the process gets stopped on its own, is there 
> any Linux log will say that ? This process is running fine in Unix 
> environment.

You will have to debug it.  There is no way for us to know what is in
your script.

There are many differences between systems.  Writing portable scripts
can be a challenge at times.  If this behaves differently between two
different systems then it is obviously sensitive in some way to the
underlying system differences.

> I use following command to start the process:
> $ nohup ${CHECKIN_TOP}/scripts/mars_checkin_daemon.sh & <enter>
> 
> I check if the process is running, I see it is running.
> $ ps -ef|grep mars_check <enter>
> marsdev   4572     1  3 Aug30 pts/0    01:40:32 /bin/ksh 
> /d002/u17/app01/mard/marsdev/scripts/mars_checkin_daemon.sh

Unfortunately as you can see it is still associated with a tty
device.  In this case pts/0.  Before job control a unix task could be
placed in the background with nohup as you show and that would be
fine.  But on job control systems this is no longer sufficient.  On
job control systems the process is still attached to the tty.  You
should disassociate from the controlling terminal.  The Perl Cookbook
if I recall correctly has an example of doing this.  But I don't have
a copy handy to look.

> After say few hours when I check if the process is running, I see it is not 
> running.
> $ ps -ef|grep mars_check <enter>
> marsdev   1417  4392  0 10:13 pts/0    00:00:00 grep mars_check

The process has apparently exited.  You will have to debug it.
There is nothing we can do here to help you with this.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]