Greg KH wrote:
Do you think that, when a fork occurs, the information can be send
to a user space progam through the kobject_hotplug() routine.
It could, but remember that calling kobject_hotplug() causes a fork
to happen itself, within the kernel. So you have to prevent
recursion :)
But that's really not the best way to do this. Why not just use the
kernel audit interface? I think that would work much better for
you.
As I don't know what is the best way to do it, I'm looking all
different way to do this. As Kernel Userspace Event is a mechanism for
kernel-to-user communication, I thought that it could be used to inform
my user space daemon when a fork occurred. Unfortunately, it seems that
this mechanism is not the best way to do this. Thank you for pointing me
the audit interface.
I also tried to use a signal but I don't think this is the solution.
The problem is that I don't know how to inform the right process (the
user space daemon). When the fork() occurred, the kernel doesn't know
the PID of the daemon, thus I need to add a mechanism to register the
daemon and I don't think it's the right way to do.
Thanks for your help
Guillaume
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/