Re: thttpd-2.2.4 + daemontools-0.76

"Dale Gallagher" <[email protected]>
Newsgroups gmane.comp.djb.syslog
Message-ID <[email protected]>
Hi Bernard

Thanks for responding... I spent some time investigating
your suggestions and resolved the issue. I think it was the
fact that in /service/thttpd/log/run I did not have the
full path to multilog, as the call to multilog happens
after the setuidgid and thttpd's path doesn't include
/usr/sbin?

Details below.

> > /service/thttpd/run:
> >
> > #!/bin/sh
> > exec setuidgid thttpd /usr/local/sbin/thttpd \
> >     -D -p 8500 -d /home/httpd/iphost/html -u thttpd \
> >     -l /dev/stdout
> 
> First you should redirect stderr to stdout to see
> thttpd's error message 
> (provided that thttpd writes an error message to stderr
> before it 
> terminates).

thttpd logs stderr by default to syslog (aargh!).
The -l switch allows redirection of stdout only.  

> I assume that /dev/stdout is only writable for root in
> this situation.

$ ls -l /dev/stdout 
lrwxrwxrwx 1 root root 4 Jun 3 18:31 /dev/stdout -> fd/1

Also, readproctitle process reads:

/dev/stdout: Permission denied

> Does it work without using setuidgid?

Hmmm... thttpd sets uid/gid to user thttpd using the -u
switch anyway, or the compiled in default if blank, so
leaving out the setuidgid command makes no difference
anyway.

I've just shut-down the thttpd service, cleaned-up the
environment, removing stale supervise for thttpd, removing
/service/thttpd/supervise and modified my log/run file with
full path to multilog.  All seems ok now - details below:

New /service/thttpd/run looks like:

#!/bin/sh
exec /usr/local/sbin/thttpd -D \
    -p 80 \
    -d /home/httpd/iphost/html \
    -l /dev/stdout

And /service/thttpd/log/run looks like:

#!/bin/sh
exec setuidgid thttpd /usr/sbin/multilog t /var/log/thttpd

Now to see how thttpd performs under CGI ;-)

Thanks
Dale
 
==
Download ringtones, logos and picture messages at Ananzi Mobile Fun.
http://www.ananzi.co.za/cgi-bin/goto.pl?mobile
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.