Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've seen plenty on how reload gracefully allows HTTP sessions to finish (as opposed to restart). So what's the difference between

service apache2 reload

and

service apache2 force-reload

Thanks :)

share|improve this question
add comment

2 Answers 2

up vote 6 down vote accepted

reload and force-reload are really just an alias for the same commands.

        graceful | reload | force-reload)
            if ! $APACHE2CTL configtest > /dev/null 2>&1; then
                $APACHE2CTL configtest || true
                log_end_msg 1
                exit 1
            fi
            log_daemon_msg "Reloading web server config" "apache2"
            if pidof_apache > /dev/null ; then
                if $APACHE2CTL graceful $2 ; then
                    log_end_msg 0
                else
                    log_end_msg 1
                fi
            fi
    ;;
share|improve this answer
add comment

It sounds like you're on a Debian or Ubuntu system. Take a look at the Apache init script in /etc/init.d/apache2; this script implements all the actions associated with the service command. Look to see the difference between reload and force-reload. If you have problems understanding the script, just ask us here.

share|improve this answer
    
Thanks :) Would appear that reload, force-reload and graceful all do the same thing (synonyms for the same case-statement block). –  samjetski Feb 24 '12 at 14:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.