FreeBSD Cron - NSSWITCH(nss_method_lookup) errors NSSWITCH(nss_method_lookup): nis, passwd_compat, endpwent, not found cron error in /var/log/cron on FreeBSD
On one of my servers, there was a strange error in cron logs which was quite annoying:
[root@www /var/log]# head cron Dec 13 10:00:05 www newsyslog[72924]: logfile turned over due to size>100K Dec 13 10:00:08 www /usr/sbin/cron[72834]: (root) CMD (/usr/libexec/atrun) Dec 13 10:00:08 www cron[72834]: NSSWITCH(nss_method_lookup): nis, group_compat, setgrent, not found Dec 13 10:00:08 www cron[72834]: NSSWITCH(nss_method_lookup): nis, group_compat, endgrent, not found Dec 13 10:00:08 www cron[72834]: NSSWITCH(nss_method_lookup): nis, passwd_compat, endpwent, not found
After searching the web a little, I found that by editing /etc/nsswitch.conf file and replacing compat with files for group and passwd fields will prevent these errors from occuring.
NAME nsswitch.conf -- name-service switch configuration file
DESCRIPTION The nsswitch.conf file specifies how the nsdispatch(3) (name-service switch dispatcher) routines in the C library should operate.
The configuration file controls how a process looks up various databases containing information regarding hosts, users (passwords), groups, etc. Each database comes from a source (such as local files, DNS, and NIS), and the order to look up the sources is specified in nsswitch.conf.
Each entry in nsswitch.conf consists of a database name, and a space sep- arated list of sources. Each source can have an optional trailing crite- rion that determines whether the next listed source is used, or the search terminates at the current source. Each criterion consists of one or more status codes, and actions to take if that status code occurs.
Sources The following sources are implemented:
Source Description files Local files, such as /etc/hosts, and /etc/passwd. dns Internet Domain Name System. ``hosts'' and `networks' use IN class entries, all other databases use HS class (Hesiod) entries. nis NIS (formerly YP) compat support `+/-' in the ``passwd'' and ``group'' databases. If this is present, it must be the only source for that entry.
Databases The following databases are used by the following C library functions:
Database Used by group getgrent(3) hosts gethostbyname(3) networks getnetbyname(3) passwd getpwent(3) shells getusershell(3)
This file allows us (among other things) to choose the order of hostname look-ups and user shell look-ups. Here's my new /etc/nsswitch.conf:
Designed and developed by Andrei Manescu. Optimized for Mozilla Firefox.
Copyright 2007 Andrei Manescu
All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by those who posted them.