From: "Dale Caldwell" <dalec@together.net>
Subject: Cron and background process problems
Date: 2000/04/07 [thread overview]
Message-ID: <38ee53a1@news.together.net> (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
next reply other threads:[~2000-04-07 4:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-07 4:00 Dale Caldwell [this message]
2000-04-07 4:00 ` Cron and background process problems Barry Margolin
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox