LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-15-2008, 07:54 AM   #1
akuma_linux
Member
 
Registered: Aug 2006
Distribution: Ubuntu, CentOS
Posts: 31

Rep: Reputation: 15
/etc/logrotate.d/apache2 - IF Statement help


Hello,

Would anyone be able to tell me what the if statement below does in the file /etc/logrotate.d/apache2 please?

Code:
if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
     /etc/init.d/apache2 reload > /dev/null
fi
Thank you

Last edited by akuma_linux; 12-15-2008 at 10:11 AM.
 
Old 12-15-2008, 07:59 AM   #2
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
reload after rotating log

I googled for the line /etc/init.d/apache2 reload and it appears to be needed when a restart won't work. Why someone configured this to happen in logrotate is beyond me. It could have been done in cron.

Perhaps whoever did this found the apache web server needed a severe kick to get going again after a log rotate.

A couple of the Google hits were tied to Ubuntu and Debian distros.
 
Old 12-15-2008, 09:32 AM   #3
akuma_linux
Member
 
Registered: Aug 2006
Distribution: Ubuntu, CentOS
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks cmnorton, although I'm interested in what this section in particular is doing?

Code:
[ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ];
Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 - how to get rid of apache2-default ozymandias Linux - Server 4 09-12-2008 11:27 AM
SuSe Apache2 error: cannot adjust 'apache2' service sir_shunt SUSE / openSUSE 14 04-18-2006 12:36 PM
Apache2 apache2-common WebDav timgerr Linux - Networking 1 08-25-2005 10:41 PM
Correct configuration for Apache2 and logrotate ricur Linux - Software 4 11-18-2004 01:22 PM
how to uninstall apache2 which is installed by emerge apache2 flybirdlong Linux - Software 1 07-17-2004 12:46 PM


All times are GMT -5. The time now is 10:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration