Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

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


Michael, FYI: I've reproduced the problem and come up with a partial solution. There's a little problem with the etag-state file ownership and permissions, just gotta figure out the best way to solve it. Should have a real solution by tomorrow at the latest. In the meantime, if you're desparate for a solution you could apply the patch included below and then:

# chown www.daemon /var/www/logs/etag-state

Thanks again and sorry for the inconvenience.

        c

  • Forwarded message from Chad Loder <cloder@openbsd.org> -----

Date: Thu, 20 Feb 2003 13:18:45 -0800
From: Chad Loder <cloder@openbsd.org>
To: henning@openbsd.org
Subject: Fwd: OpenBSD -CURRENT Bug: httpd restarts fail in chroot from etag-state

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.

Do you need help?X

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,
  • Forwarded message from Michael Schubert <schubert@fsck.org> -----

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
[Thu Feb 20 10:55:28 2003] [crit] (2)No such file or directory: could not open /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

Do you need more help?X

Hope this report isn't a dupe for you. Thanks.

-- 
schubert 

----- End forwarded message -----

----- End forwarded message -----
Received 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


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library