X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=monitor.c;h=e43e545ce196f1370ad68b78c9b02dac67ae89f9;hb=ecdbb368f8ce8bdb710d124c9b5b5e021474a77d;hp=81fef4964e0ef7279b7b7d8976ec4e72abd51ccd;hpb=b7528a20cca58c973771d94d7d2b8ef74bcf582d;p=thirdparty%2Fmdadm.git diff --git a/monitor.c b/monitor.c index 81fef496..e43e545c 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);