udhcpc creating lots of zombie processes

Andy Gibbs andyg1001 at hotmail.co.uk
Thu Feb 3 13:44:09 UTC 2011


On Thursday, February 03, 2011 2:00 PM, Denys Vlasenko wrote:

> [...snip...]
>                return -1;   <===== we do not wait for child!
>        }
>        return pid;
> }
>
> This only happens if exec fails.
>
> I want to confirm that bug indeed happens exactly here.
> Can you run "strace -tt -f -s99 -oLOG -p <pid of udhcpc>"

Thanks, the log is attached.

But, I can also confirm that somehow the script at 
/usr/share/udhcpc/default.script had lost its execute permissions. 
Re-enabling execute permissions for this file has solved the problems I have 
been seeing and I think this confirms your diagnosis!

On a different topic but still related to udhcpc, is it possible to run the 
external script on shutdown of udhcpc?  I was thinking something along the 
lines of this patch to the end of udhcpc_main:

--- dhcpc.c
+++ dhcpc.c
@@ -1311,6 +1311,9 @@
  ret0:
     retval = 0;
  ret:
+   /* call script to perform shutdown operations */
+   udhcp_run_script(NULL, "shutdown");
+
     /*if (client_config.pidfile) - remove_pidfile has its own check */
         remove_pidfile(client_config.pidfile);
     return retval;

Would this be the best way to do it?  The reason I ask is so that I can 
trigger a log/GUI event when udhcpc terminates.  Doing this event from 
deconfig is not ideal since this is called in multiple places and not just 
on shutdown.

Thanks
Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log3.tar.gz
Type: application/octet-stream
Size: 4710 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20110203/2cfb06a9/attachment.obj>


More information about the busybox mailing list