diff options
author | NeilBrown <neilb@suse.de> | 2010-02-08 04:30:46 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-02-08 07:26:18 +0100 |
commit | fa716c83c5be8093e663e260e46e73ea9ad6facf (patch) | |
tree | d114ff6697fd4c85c090facb2a13ba52d19c1eeb /monitor.c | |
parent | mdmon: don't monitor /proc/mounts to decide when to create .pid file. (diff) | |
download | 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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |