Solved

Cron newbie question in Sarge

Posted on 2006-11-27
7
353 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
People Counting Software 2 107
Problem to start Neon 20 82
Linux "time" command output redirection 16 113
How to make a Bash alias that takes parameters 5 16
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

943 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

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now