httpd: strange behaviour with CGI
Dominik Geyer
dominik.geyer at gmx.de
Sun May 18 06:29:43 PDT 2008
On Sunday 18 May 2008 14:57, Denys Vlasenko wrote:
> On Sunday 18 May 2008 14:23, Dominik Geyer wrote:
> > Hi all,
> >
> > I noticed a strange behaviour when using busybox httpd with CGI (interpreter bash).
> >
> > <snip "Example script">
> > #!/bin/bash
> >
> > /bin/true
> > echo "retval is $?" # outputs 0, thats ok
> >
> > /bin/false
> > echo "retval is $?" # outputs 0 as well, thats not ok
> >
> > # but when using bash's internal "false"
> > false
> > echo "retval is $?" # outputs 1, thats right
> >
> > </snip>
> >
> > When executing external commands the exit code is always 0.
> > For now I switched to thttpd which solved this problem, I did no further investigation.
> >
> > Tested with busybox-1.9.0 and -1.10.1 and bash-3.2.
>
> httpd was setting SIGCHLD handler to SIG_IGN.
> You need to use 1.10.2 or at least apply this patch:
>
> http://busybox.net/downloads/fixes-1.10.1/busybox-1.10.1-httpd.patch
Thanks for that info! I'll test that in a few days again.
Regards,
Dominik
More information about the busybox
mailing list