diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-10-13 17:37:02 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-10-13 17:41:58 -0700 |
commit | 9f1da8242161ba684f2867f211eb7e9d4baa84bb (patch) | |
tree | e396bffdec4ef5915f4eb138f343809431042dc0 /msg.c | |
parent | b928b5a0384e7181425a282a0586cbbb3c85fbc3 (diff) | |
download | mdadm-9f1da8242161ba684f2867f211eb7e9d4baa84bb.tar.gz |
mdmon: preserve socket over chroot
Connect to the monitor in the old namespace and use that connection for
WaitClean requests when stopping the victim mdmon instance. This allows
ping_monitor() to work post chroot().
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'msg.c')
-rw-r--r-- | msg.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -177,10 +177,8 @@ int connect_monitor(char *devname) return sfd; } -/* give the monitor a chance to update the metadata */ -int ping_monitor(char *devname) +int fping_monitor(int sfd) { - int sfd = connect_monitor(devname); int err = 0; if (sfd < 0) @@ -194,6 +192,16 @@ int ping_monitor(char *devname) if (!err && wait_reply(sfd, 20) != 0) err = -1; + return err; +} + + +/* give the monitor a chance to update the metadata */ +int ping_monitor(char *devname) +{ + int sfd = connect_monitor(devname); + int err = fping_monitor(sfd); + close(sfd); return err; } |