LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-03-2008, 01:04 PM   #1
sfjoe
Member
 
Registered: Jun 2007
Location: San Francisco
Distribution: Centos 4, Debian
Posts: 55

Rep: Reputation: 16
Apache reload vs. restart


I'm not clear on the difference between reload and restart as in :
apachectl restart | reload | stop | start

From my reading of the scripts, it looks like reload kills all processes but the parent and restart kills everything before starting.

Is that correct. Is there anything else? I'm particularly interested in knowing what happens to existing sessions, for example, a user in the middle of a multi-page signup process.
 
Old 12-03-2008, 01:11 PM   #2
hasanatizaz
Member
 
Registered: Nov 2007
Location: Pakistan
Distribution: Redhat and Debian
Posts: 317
Blog Entries: 1

Rep: Reputation: 35
i am not sure but i guess restart is used to restart the daemon and reload is used so that daemon re reads the configuration file.
 
Old 12-04-2008, 11:19 AM   #3
sfjoe
Member
 
Registered: Jun 2007
Location: San Francisco
Distribution: Centos 4, Debian
Posts: 55

Original Poster
Rep: Reputation: 16
That was my assumption at first too, but I think there is more to it than just re-reading the config file.
 
Old 12-04-2008, 01:33 PM   #4
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 111Reputation: 111
man apachectl

on my system (apache 2.2.9) I do not have a reload. Typically in start up scripts, reload is the same as restart.

I do however have
restart and graceful

the man file says that graceful will not terminate open connections and the logfile will not be closed immediately. I would only assume that a regular restart would forcefully stop everything.
 
Old 12-06-2008, 03:11 AM   #5
sunils1973
Member
 
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 340

Rep: Reputation: 30
I think reload won't stop the daemon but reread the data from configuration files

am I correct?
 
Old 12-08-2008, 12:23 PM   #6
sfjoe
Member
 
Registered: Jun 2007
Location: San Francisco
Distribution: Centos 4, Debian
Posts: 55

Original Poster
Rep: Reputation: 16
I think 'reload' might be a misnomer. After reading the init scripts that call it, I see this:
reload() {
echo -n $"Reloading $prog: "
if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then
RETVAL=$?
echo $"not reloading due to configuration syntax error"
failure $"not reloading $httpd due to configuration syntax error"
else
killproc $httpd -HUP
RETVAL=$?
fi
echo
}



The function killproc is located in /etc/init.d/functions (this is a Centos system). It appears to me that killproc is a more feature-rich version of kill.
My shell script abilities are less-than-expert but it appears to me that 'reload' is not much different than 'restart'. If you want to minimize the affect on users, then 'graceful' seems to be the correct way.
 
  


Reply



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
How to force apache To reload it's conf file????? ral0r3us Programming 2 07-30-2008 06:41 AM
add reload and restart options to the firewall script cccc Debian 2 09-27-2006 04:11 AM
Tomcat reload servlet is very slow, but reload jsp is fast and good? gsbarry Programming 2 04-28-2006 09:34 PM
How to reload /etc/my.cnf without restart mysqld? Chowroc Linux - Software 4 01-16-2006 11:52 AM
Automating firewall reload on i/f (ppp) restart aelms Linux - Security 0 10-25-2003 02:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

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
Open Source Consulting | Domain Registration