How to automatically add a nbd to a raid1?

Michael Rendell <[email protected]> Wed, 10 Dec 2008 16:29:24 -0330
Newsgroups gmane.linux.enbd.general
Message-ID <[email protected]>
Hello,

  I'd like to set up a raid1 disk that has a local disk and a remote (enbd)
disk.  Was wondering how to set things up so that, on/after reboot, the enbd
device gets added to the raid when the connection to the enbd-server is made?
The raid may already have started in degraded mode (especially likely
if the network or server is down when the client machine boots).
Running "mdadm --re-add /dev/mdNN /dev/ndA" works, but would like this to be
done automatically when the connection is made: is there a way to run
a program/script when a connection is made (like mdadm --monitor)?
or is there some other way of doing this?

Many thanks!

Michael Rendell