httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adam-apacheus...@gmi.com
Subject Solaris + chroot + /dev/null?
Date Wed, 10 Jul 2002 22:15:39 GMT
(Note that my question is at the bottom)

I'm having some strange behavior with Apache 1.3.26 (and previous versions, but I stay up
to date) with regard to running apache inside a chroot on solaris 8, with all the latest patches.

Effectively, my error_log is filled with messages like this:
httpd: unable to replace stdin with /dev/null: No such device or address
httpd: unable to replace stdout with /dev/null: No such device or address

I launch apache with this command:

chroot $HTTPD -f $HTTPD_CONFIG

if I look at a truss output (aka strace on linux) I see:

20851:  open("/dev/null", O_RDONLY)                     Err#6 ENXIO
20851:  write(2, " h t t p d", 5)                       = 5
20851:  write(2, " :   u n a b l e   t o  ".., 42)      = 42
20851:  write(2, " N o   s u c h   d e v i".., 25)      = 25
20851:  write(2, "\n", 1)                               = 1
20851:  close(1)                                        = 0
20851:  open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) Err#6 ENXIO
20851:  write(2, " h t t p d", 5)                       = 5
20851:  write(2, " :   u n a b l e   t o  ".., 43)      = 43
20851:  write(2, " N o   s u c h   d e v i".., 25)      = 25
20851:  write(2, "\n", 1)                               = 1

where 20851 is the controlling process running as root (the parent of all the child webservers,
the one that does logging, etc.)

so immediately, I thought it was a problem with my chroot, but:

# ls -laL dev/null
crw-rw-rw-   1 root     sys       13,  2 Jan  4  2002 dev/null

and

# ls -laL /dev/null
crw-rw-rw-   1 root     sys       13,  2 Jul 10 14:44 /dev/null

A quick glance at the man pages for open gives me:

     ENXIO The O_NONBLOCK flag is set, the named file is a  FIFO,
           the  O_WRONLY flag is set, and no process has the file
           open for reading; or the named  file  is  a  character
           special  or  block special file and the device associ-
           ated with this special file does not exist.

but its not a fifo, O_WRONLY is not set for the stdin (first instance above), and I don't
think O_NONBLOCK is set, but I'm not sure.

# grep O_NONBLOCK truss_log
returns nothing, and:
# grep O_WRONLY truss_log
20851:  open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) Err#6 ENXIO
which we saw above.

effectively, my question is: why is this happening, how do I fix it?  Anyone running apache
inside a chroot on Solaris out there without these errors?  (Note that when run with -X, this
error doesn't happen, but that's because the parent process isn't running as root, there isn't
a parent process, its just one running as the user.)

This isn't so much a problem, as flat apache-1.3.26 works fine, but when I happen to add apache-ssl,
it barfs on startup.  I've tracked it down to this line, even with apache-ssl (ie: if i give
it a file instead of a character device for /dev/null, it works, without errors on plain apache
and apache-ssl)  Sadly, however, the apache-ssl mailing lists have been little help (i received
one email from someone who wasn't running it in a chroot), but that didn't surprise me too
much, as I didn't expect loads of people running solaris + chroot + apache, but I could be
wrong on this.

This leads me to believe that its one of the below:
1.  a bug on apache running under chroot on solaris
2.  a bug in chroot on solaris
3.  something I am doing wrong

if it is 1, i would like to fix/help/have it fixed/etc.
if it is 2, i will somehow need to document it, so I can have Sun fix chroot.
if it is 3, just tell me what I'm doing wrong!  whee!

if you need more information, just ask.  thanks in advance.

thanks,
adam

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message