Complete.Org: Mailing Lists: Archives: linux-help: August 2002:
[linux-help] Running init.d scripts from cron
Home

[linux-help] Running init.d scripts from cron

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: linux-help@xxxxxxxxx
Subject: [linux-help] Running init.d scripts from cron
From: Jeremy W.Chalfant <jeremy@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Aug 2002 06:44:09 -0500
Reply-to: linux-help@xxxxxxxxx

I have been writing a perl script that will go through users unwanted e-mail 
folders (imap)
and delete unwanted messages in the Trash and spam folders (uses spamassassin).

I want this script to be run from cron late at night, or early in the morning.  
This is an old 
486 with 24 megs of RAM using Woody I believe (2.2.19 kernel).

The problem is this:
In my script, I turn the fetchmail and inetd daemons off so as to prevent any 
race conditions when
examining and modifiying the mail boxes with the intention of turning them back 
on when done.
The scipt works fine if executed by hand '#./cleanup.pl', but if placed in the 
crontab for root
it produced strange errors when staring and/or stopping the two daemons.

---- Out put of cron snippet ----
Stopping mail retrieval agent: fetchmail.


Restarting mail retrieval agent: fetchmail did not start.
---- End snippet ---

The second attempt it using /etc/init.d/fetchmail restart, to see if any 
results are
different.  The daemon runs as user fetchmail and it's pid file is 
/var/run/fetchmail/.fetchmail.pid
I checked to see if after cron stops the service, if the pid file was still 
there, but it wasn't.

I even tried executeing the fetchmail stop/start/restart deirectly from the 
crontab to see if there
were any different results, but 
-- This is the linux-help@xxxxxxxxx list.  To unsubscribe,
visit http://www.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]