summaryrefslogtreecommitdiffstats
path: root/monitor.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-02-08 14:30:46 +1100
committerNeilBrown <neilb@suse.de>2010-02-08 17:26:18 +1100
commitfa716c83c5be8093e663e260e46e73ea9ad6facf (patch)
treed114ff6697fd4c85c090facb2a13ba52d19c1eeb /monitor.c
parent58a4ba2a6b66ac14fa0ebaf0ce40326582d31429 (diff)
downloadmdadm-fa716c83c5be8093e663e260e46e73ea9ad6facf.tar.gz
mdadm-fa716c83c5be8093e663e260e46e73ea9ad6facf.tar.xz
mdadm-fa716c83c5be8093e663e260e46e73ea9ad6facf.zip
mdmon: insist on creating .pid file at startup.
Now that we don't "mdadm --takeover" until /var/run is writable there is no need to continually try to create files in there. So only create these files at startup and fail if they cannot be made. This means that to start an array with externally managed metadata, either /var/run or ALT_RUN (e.g. /lib/init/rw) must be writable. To 'takeover' from a previous mdmon instance, /var/run must be writable. This means we don't need to worry about SIGHUP (which was once used to tell us it was time to create .pid) and SIGALRM. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/monitor.c b/monitor.c
index 81fef49..e43e545 100644
--- a/monitor.c
+++ b/monitor.c
@@ -481,7 +481,11 @@ static int wait_and_act(struct supertype *container, int nowait)
dprintf("caught sigterm, all clean... exiting\n");
else
dprintf("no arrays to monitor... exiting\n");
- remove_pidfile(container->devname);
+ if (!sigterm)
+ /* On SIGTERM, someone (the take-over mdmon) will
+ * clean up
+ */
+ remove_pidfile(container->devname);
exit_now = 1;
signal_manager();
exit(0);