Index: lib/libc/net/nsdispatch.c =================================================================== --- lib/libc/net/nsdispatch.c +++ lib/libc/net/nsdispatch.c @@ -335,6 +335,7 @@ nss_configure(void) { static time_t confmod; + static int already_initialized = 0; struct stat statbuf; int result, isthreaded; const char *path; @@ -352,6 +353,16 @@ if (path == NULL) #endif path = _PATH_NS_CONF; +#ifndef NS_REREAD_CONF + /* + * Define NS_REREAD_CONF to have nsswitch notice changes + * to nsswitch.conf(5) during runtime. This involves calling + * stat(2) every time, which can result in performance hit. + */ + if (already_initialized) + return (0); + already_initialized = 1; +#endif /* NS_REREAD_CONF */ if (stat(path, &statbuf) != 0) return (0); if (statbuf.st_mtime <= confmod) Index: share/man/man5/nsswitch.conf.5 =================================================================== --- share/man/man5/nsswitch.conf.5 +++ share/man/man5/nsswitch.conf.5 @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2016 +.Dd October 16, 2018 .Dt NSSWITCH.CONF 5 .Os .Sh NAME @@ -62,7 +62,7 @@ Each criterion consists of one or more status codes, and actions to take if that status code occurs. .Ss Sources -The following sources are implemented: +The following sources are implemented as part of the base system: .Pp .Bl -tag -width Source -compact .It Sy Source @@ -100,6 +100,8 @@ .Xr nscd 8 daemon. .El +.Pp +Additional sources might be provided by third party software. .Ss Databases The following databases are used by the following C library functions: .Pp @@ -340,6 +342,12 @@ This treats nis as the authoritative source of information, except when the server is down. .Sh NOTES +The +.Nm +file is parsed by each program only once. +Subsequent changes will not be applied until the program +is restarted. +.Pp If system got compiled with .Va WITHOUT_NIS you have to remove