FS#16994 - [apache] check config before reloading/restarting
Attached to Project:
Arch Linux
Opened by Florian Pritz (bluewind) - Tuesday, 03 November 2009, 19:20 GMT
Last edited by Andrea Scarpino (BaSh) - Saturday, 07 November 2009, 16:18 GMT
Opened by Florian Pritz (bluewind) - Tuesday, 03 November 2009, 19:20 GMT
Last edited by Andrea Scarpino (BaSh) - Saturday, 07 November 2009, 16:18 GMT
|
Details
Description:
If you run /etc/rc.d/httpd restart with a broken config your server terminates without any warning. Patch attached. |
This task depends upon
Closed by Andrea Scarpino (BaSh)
Saturday, 07 November 2009, 16:18 GMT
Reason for closing: Upstream
Additional comments about closing: https://issues.apache.org/bugzilla/show_ bug.cgi?id=45103
Saturday, 07 November 2009, 16:18 GMT
Reason for closing: Upstream
Additional comments about closing: https://issues.apache.org/bugzilla/show_ bug.cgi?id=45103
:: Restarting httpd daemon [FAIL]
no bug here
Why doesn't that work here then?
Same output with restart btw.
> ps aux | grep http
[...]
root 759 0.7 0.1 8520 3072 pts/5 S+ 20:41 0:00 vim httpd.conf
http 17862 0.0 0.3 21372 7524 ? S Nov01 0:00 /usr/sbin/httpd -k start
> rc httpd reload
:: Reloading httpd daemon [DONE]
> ps aux | grep http
root 759 0.5 0.1 8520 3072 pts/5 S+ 20:41 0:00 vim httpd.conf
/usr/sbin/apachectl restart &>/dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
add_daemon $daemon_name
stat_done
fi
apachectl return exist status=1 if httpd.conf is wrong
root 2427 0.2 0.1 8516 3088 pts/6 S+ 20:49 0:00 vim httpd.conf
[..]
http 2695 0.0 0.3 23120 7876 ? S 20:49 0:00 /usr/sbin/httpd -k restart
> sudo apachectl -k restart
Syntax error on line 482 of /etc/httpd/conf/httpd.conf:
Invalid command 'asasdasd', perhaps misspelled or defined by a module not included in the server configuration
> echo $?
0
> ps aux eg http
root 2427 0.2 0.1 8516 3088 pts/6 S+ 20:49 0:00 vim httpd.conf
flo 2957 0.0 0.0 4384 812 pts/7 S+ 20:50 0:00 egrep --color http
http 28584 0.0 0.3 20268 7124 ? S 20:54 0:00 /usr/sbin/httpd -k start
:: Restarting httpd daemon [FAIL]
$ ps aux | grep http
http 28584 0.0 0.3 20268 7124 ? S 20:54 0:00 /usr/sbin/httpd -k start
here restart fails, cause httpd.conf is wrong, but he doesn't stop apache.