Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Cron and background process problems
@ 2000-04-07  4:00 Dale Caldwell
  2000-04-07  4:00 ` Barry Margolin
  0 siblings, 1 reply; 2+ messages in thread
From: Dale Caldwell @ 2000-04-07  4:00 UTC (permalink / raw)


I'm trying to resolve a problem with cron running a script.  (Compaq Tru64,
v4.0F system, using Bourne shell script)

I have some internet API processes that I need running 24/7.  I've put
together a script to look for these individual processes and restart any
that have failed.

Basic logic:
#!/bin/sh
    look at process list
    if process X not found
        log message "process not found"
        restart process &
        log message X restarted
        do a "ps -ef |grep X" and log output to file
    end

This script works great manually.  I can kill all or selective processes,
run my script and the appropriate action is taken, then the log file is
emailed to me.

If I put the script into crontab, running every 5 minutes,  the log file is
sent, but the processes don't exist.

I suspect that every time cron runs, restarts the 'dead' process, it then
shuts down.  When cron shuts down, the processes are being killed.

Here is a sample of my restart command.  It should be sent to the background
(&) I think.

Does anyone have any cron knowledge that could explain why this happens?  I
can manually run the script, log completely off the system, and the API
processes will be left running.

I'm lost.

Thanks - Dale
dale@gardeners.com





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-04-07  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-04-07  4:00 Cron and background process problems Dale Caldwell
2000-04-07  4:00 ` Barry Margolin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox