However, sometimes, it cause trouble.In Red Hat Linux 5 , nscd always return the old entry until the TTL(default is 1hour) is reached, even restarting nscd won’t flush the cache.
There are two solutions:
1.Disable persistent caching
With persistent caching disabled, restart nscd will discard the entries in memory.#Persistent caching is enabled by default
$cat /etc/nscd.confpersistent passwd yespersistent group yespersistent hosts yespositive-time-to-live hosts 3600#So the entries are saved to relative tables
$rpm -ql nscd../var/db/nscd/group/var/db/nscd/hosts/var/db/nscd/passwd…#change them to no
persistent passwd nopersistent group nopersistent hosts no
2.Flush entries by invalidating the table
The entries in tables (group/passwd/hosts) can manually flushed by the ‘invalidate ‘parameter.
Since it is natural for anyone to try restart nscd to resolve the issue and the operation of rebuilding cache is not expensive, I think option 1 is better.$nscd --invalidate=hosts
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.