httpd: strange behaviour with CGI

Denys Vlasenko vda.linux at googlemail.com
Sun May 18 12:57:33 UTC 2008


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
--
vda



More information about the busybox mailing list