On 13.03.2015 16:53, Natanael Copa wrote:
I have the feeling (without digging into the busybox code) that making mdev suitable for a longlived daemon will not be that easy. I suspect there are lots of error handling that will just exit. A long lived daemon would need log and continue instead.
The major mdev part, will not be converted in a long lived daemon. That is more or less code in a process doing a job like cat, but still you are right. It will take some time and has to be done carefully. No doubt.
One of the reasons to have that "fifo supervisor" is the failure management. Even if the parser / handler process dies, this is catched and can fire up a failure script (something we do not have now).
The kernel hotplug handler stays as a normal process at all, does only need to write the gathered info to the pipe instead of a function to handle the event operation, so it is mainly replacing the handler function with a write to the named pipe, and on the other sid the hotplug gathering part is replaced by a read from stdin (pipe) with timeout.
So major work will go to the code resorting parser / device operation handler, but I expect the need of doing a parser rewrite (which is straight forward for that simple syntax).
Don't misunderstand, it will be an expensive piece of work, but compared to finding a specific bug in a 30000 line of a program from somebody else, the mdev code is simple ... and it's not my first Busybox hacking, it is only the first time do that as public discussion in this channel / list. I started creating specialized BB versions around 1995, so some experience now.
Did you note that pseudo code for the fifo supervisor? May be it hopped to the other thread. That is standard code, more or less, comparable to e.g. tcpsvd
_______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
