FreeBSD - Tutorials, Security
Home   Archives   Sitemap   About   Contact

FreeBSD Cron - NSSWITCH(nss_method_lookup) errors

Home NEW! Unix Forum News 100 Tips and Tricks Website Development Server Operating Systems Databases
 Ivorde.ROarrow Server Operating Systems arrowProblems and SolutionsarrowFreeBSD Cron - NSSWITCH(nss_method_lookup) errors 

Article Sections

    Hello, Guest !
User name:

 SSD VPS Hosting -
 Ivorde forum
 FreeBSD Tutorials
 Linux LVM Commands
 Free Shell Accounts
 FreeBSD Project
 FreeBSD Handbook
 Advanced Bash-Scripting Guide
 The OpenBSD Project
 FreeBSD Handbook

Apache Webserver Home Page

Posted on: 06 Jan 2008
Author: mandrei
Section: Server Operating Systems | Problems and Solutions
Views: 10649
Comments: 1 (Add)

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.

Here's a little something from man nsswitch.conf:

NSSWITCH.CONF(5)          FreeBSD File Formats Manual         NSSWITCH.CONF(5)

     nsswitch.conf -- name-service switch configuration file

     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.

     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.

     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:

group: files
group_compat: nis
hosts: files dns
networks: files
passwd: files
passwd_compat: nis
shells: files

I'll read into it and post if any new comments.

Bookmarks: Echo "FreeBSD Cron - NSSWITCH(nss_method_lookup) errors" around:

Other articles in Server Operating Systems / Problems and Solutions
» How to remount UNIX filesystems with one command
» Error installing world on FreeBSD 6.3
» Unix - How to find the largest 10 files in a filesystem
» How to change Environment Variable $MAIL on FreeBSD box
» FreeBSD: How to enable vulnerability check while installing a port?

Contact webmaster regarding this article
Register or Login to post your article
Hello, Guest ! You can Login or Register to!

 Post comment:

Please type the word you see in the image (anti-spam verification). Refresh the page if you don't understand the word.
Allowed HTML Tags for comments:<p><strong><em><u><h1><h2><h3><h4><h5><h6><img><li>

1 comment(s) to FreeBSD Cron - NSSWITCH(nss_method_lookup) errors:

1. Re: FreeBSD Cron - NSSWITCH(nss_method_lookup) errors
- by kworr at June 11th, 2008 - 03:01
You probably compiled your world WITHOUT_NIS. I ran into same problems trying to use hesiod...

   Latest topics on the forum:
   Most viewed articles:
How to copy a mysql database using mysqldump - 26911 views
FreeBSD: Add/remove an additional IP alias - 23157 views
How to change a user's password in AIX with the output from ECHO command - 20193 views
Qmail relay to smarthost: How to route all mail to a smarthost - 15065 views
How to remove first/last character from a string using SED - 13986 views

   Latest 10 articles:
Qmail relay to smarthost: How to route all mail to a smarthost - 03 Feb 2009
EXIM 4 relay to smarthost: How to route all mail except local domain - 03 Feb 2009
Windows XP: print LISTEN ports and network connections using netstat - 30 Jan 2009
How to cut out first last n characters from each file name, from a filelist - 04 Nov 2008
Mozilla Firefox3 is now released - 18 Jun 2008
How to switch lower case to upper case and upper case to lower case in a string - 17 Jun 2008
How to rename files/directories to uppercase/lowercase character names - 17 Jun 2008
How to convert lower case to upper case letters in a shell script/command - 17 Jun 2008
Unix,Linux,FreeBSD - How to rename a list of files, replacing spaces inside their names - 12 Jun 2008
How to change a user's password in AIX with the output from ECHO command - 21 May 2008

» 2007  |  June  |  October  |  November  |  December
» 2008  |  January  |  February  |  March  |  April  |  May  |  June  |  November
» 2009  |  January  |  February

Home | Archives | Sitemap | About | Contact

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.
Valid W3 Document Valid XHTML 1.0 Transitional Valid CSS! The FreeBSD Project Viewable With Any Browser