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'm using Ubuntu Server 9.04 and I've installed Apache2 on it.

I want to restart my Apache gracefully but I only can restarting it using this command:

/etc/init.d/apache2 restart

And if I'm not wrong it doesn't have graceful option parameter.

I don't have this command installed:

apachectl

thanks

Update

sudo /etc/init.d/apache2 graceful
 * Usage: /etc/init.d/apache2 {start|stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean|status}
share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

On Ubuntu apachectl is /usr/sbin/apache2ctl

share|improve this answer
    
@lain Ok thanks. Is it normal that I don't get any feedback message after the command ? For example, when I use "apache2 restart" I can see 2 lines "Apache restarting..." but apache2ctl just doesn't provide any additional info. Maybe just because everything went well ? –  Patrick Oct 8 '10 at 7:22
    
If there were any errors apache2ctl would report them. –  Iain Oct 8 '10 at 7:44
add comment

/etc/init.d/apache2 accepts graceful parameter. reload parameter does the same. You can use either:

/etc/init.d/apache2 graceful

or

/etc/init.d/apache2 reload

to pass graceful parameter to apache2ctl

Edit:

It exists. look at source of /etc/init.d/apache2:

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
    
uhm.. not really apache2 graceful doesn't exist.. see my updated question. –  Patrick Oct 8 '10 at 8:13
    
About apache2 reload: is it exactly like graceful ? –  Patrick Oct 8 '10 at 8:14
    
Yes it does. See my edit. –  Casual Coder Oct 8 '10 at 8:57
    
ok. Maybe your version does not have it. I am working now on 10.04. But reload should do the same as graceful if in doubt look at source of /etc/init.d/apache2 it should call at some point $APACHE2CTL graceful. –  Casual Coder Oct 8 '10 at 9:07
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.