Solved

Cron newbie question in Sarge

Posted on 2006-11-27
7
352 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
Comment Utility
Apache gets restarted as part of the weekly log rotation.  

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

Expert Comment

by:Duncan Roe
Comment Utility
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
Comment Utility
OTOH it could be what Tintin said. Especially seeing you looked in cron.weekly
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 48

Expert Comment

by:Tintin
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
thank you Tintin
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

762 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

6 Experts available now in Live!

Get 1:1 Help Now