Solved

Cron newbie question in Sarge

Posted on 2006-11-27
7
354 Views
Last Modified: 2010-04-20
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!
0
Comment
Question by:sow56091
  • 3
  • 2
  • 2
7 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 18022272
Apache gets restarted as part of the weekly log rotation.  

See /etc/logrotate.d/apache*
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 18022332
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
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 18022373
OTOH it could be what Tintin said. Especially seeing you looked in cron.weekly
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 48

Expert Comment

by:Tintin
ID: 18022396
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
0
 
LVL 3

Author Comment

by:sow56091
ID: 18029989
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...

0
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 18030885
Ah, the classic XY problem.

So what you *really* want to do is configure Apache to automatically start your SSL site.  To do this, you need to remove the passphrase from the cert, by doing:

cd /etc/httpd/conf/ssl.key
cp yoursite.key yoursite.crypt
openssl rsa -in yoursite.crypt -out yoursite.key
chmod 400 yoursite*

0
 
LVL 3

Author Comment

by:sow56091
ID: 18143925
thank you Tintin
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question