diff options
Diffstat (limited to 'usr.sbin/rpc.umntall')
-rw-r--r-- | usr.sbin/rpc.umntall/mounttab.c | 11 | ||||
-rw-r--r-- | usr.sbin/rpc.umntall/rpc.umntall.8 | 2 | ||||
-rw-r--r-- | usr.sbin/rpc.umntall/rpc.umntall.c | 11 |
3 files changed, 15 insertions, 9 deletions
diff --git a/usr.sbin/rpc.umntall/mounttab.c b/usr.sbin/rpc.umntall/mounttab.c index 7ebd6e5..d15b42a 100644 --- a/usr.sbin/rpc.umntall/mounttab.c +++ b/usr.sbin/rpc.umntall/mounttab.c @@ -151,6 +151,11 @@ write_mtab() { strlen(mtabp->mtab_host) > 0) { fprintf(mtabfile, "%ld\t%s\t%s\n", mtabp->mtab_time, mtabp->mtab_host, mtabp->mtab_dirp); + if (verbose) { + warnx("write entry " "%s:%s", + mtabp->mtab_host, mtabp->mtab_dirp); + } + clean_mtab(mtabp->mtab_host, mtabp->mtab_dirp); line++; } } @@ -178,14 +183,14 @@ clean_mtab(char *hostp, char *dirp) { strcmp(mtabp->mtab_host, host) == 0) { if (dirp == NULL) { if (verbose) { - warnx("entries deleted for " + warnx("delete entries " "host %s", host); } bzero(mtabp->mtab_host, RPCMNT_NAMELEN); } else { if (strcmp(mtabp->mtab_dirp, dirp) == 0) { if (verbose) { - warnx("entry deleted for " + warnx("delete entry " "%s:%s", host, dirp); } bzero(mtabp->mtab_host, RPCMNT_NAMELEN); @@ -217,5 +222,5 @@ free_mtab() { void badline(char *bad) { - syslog(LOG_ERR, "skipped bad line in mounttab with entry %s", bad); + syslog(LOG_ERR, "skip bad line in mounttab with entry %s", bad); } diff --git a/usr.sbin/rpc.umntall/rpc.umntall.8 b/usr.sbin/rpc.umntall/rpc.umntall.8 index 3988a98..268e0fc 100644 --- a/usr.sbin/rpc.umntall/rpc.umntall.8 +++ b/usr.sbin/rpc.umntall/rpc.umntall.8 @@ -77,7 +77,7 @@ All entries which are not actually mounted or older than .Pa /var/db/mounttab . This may be the case for DNS changes or long out of service periods. Default expire time -is 172800 seconds (2 days). +is 86400 seconds (one day). .It Fl h Ar host Only remove the specific hostname. Send a UMNTALL RPC to the NFS server. .It Fl k diff --git a/usr.sbin/rpc.umntall/rpc.umntall.c b/usr.sbin/rpc.umntall/rpc.umntall.c index 11f07ec..c59c776 100644 --- a/usr.sbin/rpc.umntall/rpc.umntall.c +++ b/usr.sbin/rpc.umntall/rpc.umntall.c @@ -96,9 +96,9 @@ main(int argc, char **argv) { signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); - /* Default expiretime is two days */ + /* Default expiretime is one day */ if (expire == 0) - expire = 172800; + expire = 86400; /* * Read PATH_MOUNTTAB and check each entry * and do finally the unmounts. @@ -106,7 +106,7 @@ main(int argc, char **argv) { if (host == NULL && path == NULL) { if (!read_mtab(mtab)) { if (verbose) - warnx("nothing to do, remove %s", + warnx("nothing to do, %s does not exist", PATH_MOUNTTAB); } for (mtab = mtabhead; mtab != NULL; mtab = mtab->mtab_next) { @@ -115,12 +115,13 @@ main(int argc, char **argv) { if (keep && is_mounted(mtab->mtab_host, mtab->mtab_dirp)) { if (verbose) { - warnx("skipping entry %s:%s", + warnx("skip entry %s:%s", mtab->mtab_host, mtab->mtab_dirp); } } else if (do_umount(mtab->mtab_host, - mtab->mtab_dirp)) { + mtab->mtab_dirp) || + mtab->mtab_time <= (time(now) - expire)) { clean_mtab(mtab->mtab_host, mtab->mtab_dirp); } |