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:52:06 -0500
Reply-to: linux-help@xxxxxxxxx

Sorry about the extra message, but I accidently hit the send button with my 
thumb (stupid touch pads)

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 no success :(

I have been fighting this cor a couple days now, and have run out of ideas.  I 
have searched
groups.google.com and found a few with similar problems, but no one seems to 
know an answer for it.
May this problem have some similarities to setuid perl scripts and cgi's in 
that one can execute them
by using a C program to call the script as setuid?  i have no idea, and am just 
grasping straws.

Thanks for your time.

Jermey
-- 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]