RE: kernel_thread vs. zombie

Martin Frey (frey@scs.ch)
Thu, 22 Mar 2001 17:57:51 -0800


>> - When started during boot (low PID (9)) It becomes a zombie
>> - When started from a process that quits after sending the ioctl,
>> it is correctly "garbage collected".
>> - When started from a process that stays around, it becomes
>> a zombie too

>Take a look at kernel/kmod.c:call_usermodehelper(). Copy it.
>
>This will make your thread a child of keventd. This takes
>care of things like chrootedness, uids, cwds, signal masks,
>reaping children, open files, and all the other crud which
>you can accidentally inherit from your caller.
>
So depending on the state of the caller daemonize() will not really
put us into the background as we want. With being created from
keventd we inherit a state as we'd like to have in a kernel thread.
Did I get it right?
I will change my example and test that.

Thanks,

Martin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/