Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


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

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


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

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

Last edited by akuma_linux; 12-15-2008 at 10:11 AM.
Old 12-15-2008, 07:59 AM   #2
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
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?

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


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:44 AM.

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