Link to home
Start Free TrialLog in
Avatar of sow56091
sow56091

asked on

Cron newbie question in Sarge

Hi experts,

Every Sunday at 6:25am, I receive this message in /var/log/apache2/error.log
[Sun Nov 26 06:25:39 2006] [error] Init: Unable to read pass phrase [Hint: key introduced or changed before restart?]

It appears that cron(?) is restarting apache2 once per week, but I don't know how to stop that. I tried #crontab -e, but the cron job is not listed. I also looked in /etc/cron.weekly, but no luck either. I could try keychain, but how do I stop that job?

Other helpful info:
===
#uname -a
Linux 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686 GNU/Linux


Thanks!
Avatar of Tintin
Tintin

Apache gets restarted as part of the weekly log rotation.  

See /etc/logrotate.d/apache*
Probably there is a script in /etc/cron.weekly which is doing it.
The way to stop a script in that dir from running is to remove its execute access:

   chmod a-x {script name}

By way of explanation as to how this works, when you (as root) did  crontab -e, did you notice a line like the one following?

  30 4 * * 0 /usr/bin/run-parts /etc/cron.weekly 1> /dev/null

(That one runs jobs at 0430hrs, yours will be different). /usr/bin/run-parts is a shell script - have a look if you are interested
OTOH it could be what Tintin said. Especially seeing you looked in cron.weekly
The logrotate is actually invoked daily

/etc/cron.daily/logrotate

If you really want to stop apache from having logs rotated and being restarted (not sure why you'd want to do that), then just remove

/etc/logrotate.d/apache
/etc/logrotate.d/apache-ssl
Avatar of sow56091

ASKER

Tintin, yes, that is the cause. Thank you!

>>not sure why you'd want to do that
  I have an SSL cert with passphrase, and when Apache2 restarts, it asks me for my passphrase though I'm not available to provide it, causing the web site to go down. I imagine this is a common problem. How would you fix that? My thought was to prevent the restart, but as you've pointed out, that would also affect the log rotation...

ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you Tintin