|
|||||||||||
|
Re: OpenBSD -CURRENT Bug: httpd restarts fail in chroot from etag-state
From: Chad Loder <cloder(at)loder.us>
Date: Thu Feb 20 2003 - 16:24:58 EST # chown www.daemon /var/www/logs/etag-state Thanks again and sorry for the inconvenience. c
Date: Thu, 20 Feb 2003 13:18:45 -0800
Henning, I've reproduced this problem and come up with a partial fix. Unfortunately, the fix runs into problems because the etag-state file is owned by root.daemon and is mode 0600. After the HUP (and chroot), we can't open the file because it appears at that point we're running as user www. Any suggestions? Here's the diff for the partial solution. Index: src/main/http_protocol.c RCS file: /cvs/src/usr.sbin/httpd/src/main/http_protocol.c,v retrieving revision 1.18 diff -u -r1.18 http_protocol.c --- src/main/http_protocol.c 2003/02/17 03:14:33 1.18 +++ src/main/http_protocol.c 2003/02/20 21:41:29@@ -3199,9 +3199,15 @@ ap_SHA1Init(&baseCtx);
if ((fd = open(filename, O_CREAT|O_RDWR|O_NOFOLLOW, 0600)) == -1) {
ap_log_error(APLOG_MARK, APLOG_CRIT, NULL,
Someone on irc mentioned this so I tested it on my -current box (from feb 18th). It appears that when you run httpd without -u, on startup it creates the /var/www/logs/etag-state just all happy and fine and if you start then start the proccess again it works great. But when you issue a restart (from apachectl which is just a kill -HUP <pid>) apache dies and barfs this out into error_log:
[Thu Feb 20 10:55:28 2003] [notice] SIGHUP received. Attempting to restart
[Thu Feb 20 10:55:28 2003] [notice] Initializing etag from
/var/www/logs/etag-state
And from the looks of it then its trying to find /var/www/var/www/logs/etag-state (verified this running httpd -u and creating /var/www/var/www/logs/etag-state symlink). the abs path of etag-state is in src/main/http_protocol.c Hope this report isn't a dupe for you. Thanks. -- schubertReceived on Thu Feb 20 16:50:25 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:50 EDT |
||||||||||
|
|||||||||||