Newsgroups: comp.unix.questions
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!barmar
From: barmar@think.com (Barry Margolin)
Subject: Re: How to kill cron and start cron again, using cron ?
Message-ID: <1991Apr8.191418.4855@Think.COM>
Keywords: cron(1), kill, HELP NEEDED!
Sender: news@Think.COM
Organization: Thinking Machines Corporation, Cambridge MA, USA
References: <1933@ahds.UUCP>
Date: Mon, 8 Apr 91 19:14:18 GMT

In article <1933@ahds.UUCP> geert@ahds.UUCP (Geert W.T. Jonkheer CCS/TS) writes:
>For a reason, i want to kill cron(1) for a little moment and
>then start it again (when there are now processes running, started
>by cron).
...
>The killing of cron, will succeed, but after it has been killed, 
>it never starts up again. The program that killed cron, doesn't
>run anymore, because it killed his parent 'cron'. 

That seems strange.  Processes don't normally die just because their parent
died.

Maybe the signal is being propogated to the entire process group.  If this
is the problem, you can get around it by having the killer process get its
own process group.

>I've tried to start cron(1) from init(1), using an 
>inittab(4) entry for cron. I'll quote:
>
>'cron:1:respawn:/etc/cron' 
>
>But when i did this, cron(1) starts over 
>and over again, apparently init(1) does not see that cron has 
>already started yet.

Init(1) doesn't expect the command to exit until it is done.  Cron(1) forks
a background process and then the original process exits, so init(1) thinks
it is done and runs it again.
--
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar
