X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmountd%2Fmountd.c;h=25d292bdc5efeafc8f82362343723986018dd64d;hp=8084359e290edd34faf489d56ff7a268b649d1f1;hb=f0ed8401e854e1cbd23b2fb5dca5e88dec2df7c4;hpb=c56152202a3000c69b87f9cb90f40166f1f21275 diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index 8084359..25d292b 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -88,6 +88,14 @@ unregister_services (void) pmap_unset (MOUNTPROG, MOUNTVERS_NFSV3); } +static void +cleanup_lockfiles (void) +{ + unlink(_PATH_XTABLCK); + unlink(_PATH_ETABLCK); + unlink(_PATH_RMTABLCK); +} + /* Wait for all worker child processes to exit and reap them */ static void wait_for_workers (void) @@ -154,6 +162,7 @@ fork_workers(void) /* in parent */ wait_for_workers(); unregister_services(); + cleanup_lockfiles(); xlog(L_NOTICE, "mountd: no more workers, exiting\n"); exit(0); } @@ -170,6 +179,7 @@ killer (int sig) kill(0, SIGTERM); wait_for_workers(); } + cleanup_lockfiles(); xlog (L_FATAL, "Caught signal %d, un-registering and exiting.", sig); }