How to kill cron and start cron again, using cron ?

Barry Margolin barmar at think.com
Tue Apr 9 05:14:18 AEST 1991


In article <1933 at ahds.UUCP> geert at 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 at think.com
{uunet,harvard}!think!barmar



More information about the Comp.unix.questions mailing list