Date: Thu, 26 Sep 2002 16:04:23 +0200 (MEST) From: Paul Everlund <tdv94ped@cs.umu.se> To: Danny Pansters <danny@ricin.com> Cc: freebsd-questions@freebsd.org Subject: Re: Cron leaving a zombie Message-ID: <Pine.GSO.4.44.0209261525170.863-100000@kvist.cs.umu.se> In-Reply-To: <200209261358.26429.danny@ricin.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 26 Sep 2002, Danny Pansters wrote: Thanks for your reply! > On Thursday 26 September 2002 11:30, Paul Everlund wrote: > > case "$1" in > > start) > > echo -n ' adac' > > /usr/local/sbin/adac 4444 > /dev/null & > ^^^^^^^^^^^^^ > [SNIP] > > > restart) > > /bin/kill `/bin/cat /var/run/adac.pid 2> /dev/null` 2> /dev/null > > /bin/rm -f /var/run/adac.pid > > sleep 5 > > /usr/local/sbin/adac 4444 & > /dev/null > ^^^^^^^^^^^^^ > > > Then I did put this in roots crontab: > > 10 0 * * * /usr/local/etc/rc.d/adac.sh restart > > <sidenote> > Hmmm. IMHO an rc restart script shouldn't be cron'd like this. Or don't call > it a daemon. But hey, it's your box :) > </sidenote> Yup! :-) It's something like a "daemon", but it stops after it has received 2048 images, and that's why I want to restart it every 24th hour. Before it hits the limit though, it acts just like a daemon. > > The adac-daemon is restarted, but everytime the job runs it leaves a > > sh-zombie from the cron-job. By killing the cron-job, the sh-zombie > > disappears (as it should). > > > > Do anyone know why this is happening? > > I think I do. It's not cron, it's your rc script. See ^^^^^^ above. I know it's my script, and not cron. :-) > The sh is waiting because you tell it to redirect stdout from a background > process it had to spawn to /dev/null (in the restart case). Then the child > gets killed, turning the sh process into a zombie. Hard to test without the > actual adac script/program though. Removing redirections to /dev/null did not help. It still leaves a zombie. > HTH, > > Dan Best regards, Paul To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.44.0209261525170.863-100000>