Tracking a process started from a kernel module

almesber en lrc.di.epfl.ch almesber en lrc.di.epfl.ch
Vie Ene 28 01:00:27 CST 2000


breed en almaden.ibm.com wrote:
> I have a kernel module that during the init_module calls kernel _thread,
> sets up two pipes, dups stdin and out, then execs a program that
> periodically I will communicate with the program from the kernel through
> the pipes.  Everything is working fine, but I would like to be able to get
> a callback when a program goes away, so that I can gracefully recover.  I
> don't see any hooks for this in the kernel.  Is there a way to do this?

Try creating a misc device. VFS will call its release function on close.
(Also works for sockets, etc., but misc devices are easier to handle.)

That way, you can also avoid exec'ing things from kernel threads, which
is probably a very good thing to avoid anyway ;-)

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH       werner.almesberger en ica.epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/

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



Más información sobre la lista de distribución Ayuda