Make sure we remove pid file in monitor before manager exits.
authorNeil Brown <neilb@suse.de>
Sat, 12 Jul 2008 10:27:42 +0000 (20:27 +1000)
committerNeil Brown <neilb@suse.de>
Sat, 12 Jul 2008 10:27:42 +0000 (20:27 +1000)
monitor.c

index fda3fc0..46d5e0a 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -445,9 +445,9 @@ static int wait_and_act(struct supertype *container, int nowait)
                if (fd >= 0 || errno != EBUSY) {
                        /* OK, we are safe to leave */
                        dprintf("no arrays to monitor... exiting\n");
+                       remove_pidfile(container->devname);
                        exit_now = 1;
                        signal_manager();
-                       remove_pidfile(container->devname);
                        exit(0);
                }
        }