(slightly ot: was: Backround process dies

From: Bruntel, Mitchell L, ALABS (mbruntel@att.com)
Date: Thu Feb 12 2004 - 09:40:25 EST


Just a quick note: After going thru a (QUITE painful) qmail install on
OpenBSD, I noted that a standard Qmail installation uses a series of
programs called daemontools (also written by same author of qmail).
Daemontools does EXACTLY this.
It Supervises that a process continually runs, and restarts as
necessary.

Hope this helps.. (google qmail daemontools djb)

Mitch
-----Original Message-----
From: Gurugunti, Mahesh [mailto:MGurugunti@us.nomura.com]
Sent: Wednesday, February 11, 2004 4:40 PM
To: 'sunmanagers@sunmanagers.org'
Subject: SUMMARY: Backround process dies

My Question was

Hi,
>
> One of our developers has written a simple shell script which monitors
> (greps) a process and if this monitored process does not exist, it
> starts it.
>
> This script is run as a user as a backround job (script &) from a
> command line and then the user logs out.
>
> This script dies intermittently, and he wants to know the
reasons/conditions
> on which this monitoring job dies.

The responses I received are below, Thanks for the responses folks.

Hi Guy,

try to run the process with the command nohup.

It detach process from the terminal, so, the user can logout its session
without killing background processes.

Bye.
Fabio Cannone

Hi Mahesh,
every script which shouldn't terminate upon termination of the shell
process it was invoked from, needs to be started with nohup (see man
nohup for details), this is independent from the script itself. For the
script, you (or your developer) might want to look into using pgrep.
Barbara

The usual reasons are..

1) Receives a signal (like HUP) that it does not handle.
2) Attempts to write data to a filedesriptor (like STDOUT) that is no
   longer connected to anything (would happen if someone logged out of a
   terminal.)
3) Attempts to read data from a filedescriptor that is no longer
   attached to anything.

Nohup tends to solve problems with #1 and #2. Redirecting input from
/dev/null tends to solve #3.

And a bunch of "Out of Office" auto responses.

----- This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please delete it and all copies
from your system, destroy any hard copies and notify the sender. You
must not, directly or indirectly, use, disclose, distribute, print, or
copy any part of this message if you are not the intended recipient.
Nomura Holding America Inc., Nomura Securities International, Inc, and
their respective subsidiaries each reserve the right to monitor all
e-mail communications through its networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorized to state the views of such
entity. Unless otherwise stated, any pricing information in this message
is indicative only, is subject to change and does not constitute an
offer to deal at any price quoted. Any reference to the terms of
executed transactions should be treated as preliminary only and subject
to our formal written confirmation.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:28:02 EDT