Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.