# NSSWITCH(_nsdispatch): ... not found, and no fallback provided



## Erratus (Jul 7, 2013)

NSSWITCH(_nsdispatch) fills  /var/log/cron 

```
# uname -srp
FreeBSD 9.1-RELEASE-p2 i386
# cat /var/log/cron
Jul  7 10:00:00 LH64 /usr/sbin/cron[65596]: (root) CMD (newsyslog)
Jul  7 10:00:00 LH64 /usr/sbin/cron[65598]: (root) CMD (/usr/libexec/atrun)
Jul  7 10:00:00 LH64 cron[65596]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
Jul  7 10:00:00 LH64 /usr/sbin/cron[65597]: (operator) CMD (/usr/libexec/save-entropy)
Jul  7 10:00:00 LH64 cron[65598]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
Jul  7 10:00:00 LH64 cron[65597]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
Jul  7 10:05:00 LH64 /usr/sbin/cron[65624]: (root) CMD (/usr/libexec/atrun)
Jul  7 10:05:00 LH64 cron[65624]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
Jul  7 10:10:00 LH64 /usr/sbin/cron[65641]: (root) CMD (/usr/libexec/atrun)
Jul  7 10:10:00 LH64 cron[65641]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
Jul  7 10:11:00 LH64 /usr/sbin/cron[65646]: (operator) CMD (/usr/libexec/save-entropy)
Jul  7 10:11:00 LH64 cron[65646]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
Jul  7 10:15:00 LH64 /usr/sbin/cron[65669]: (root) CMD (/usr/libexec/atrun)
Jul  7 10:15:00 LH64 cron[65669]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
Jul  7 10:20:00 LH64 /usr/sbin/cron[65687]: (root) CMD (/usr/libexec/atrun)
Jul  7 10:20:00 LH64 cron[65687]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
Jul  7 10:22:00 LH64 /usr/sbin/cron[65695]: (operator) CMD (/usr/libexec/save-entropy)
Jul  7 10:22:00 LH64 cron[65695]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
Jul  7 10:25:00 LH64 /usr/sbin/cron[65716]: (root) CMD (/usr/libexec/atrun)
Jul  7 10:25:00 LH64 cron[65716]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
Jul  7 10:30:00 LH64 /usr/sbin/cron[65732]: (root) CMD (/usr/libexec/atrun)
Jul  7 10:30:00 LH64 cron[65732]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
Jul  7 10:33:00 LH64 /usr/sbin/cron[65743]: (operator) CMD (/usr/libexec/save-entropy)
Jul  7 10:33:00 LH64 cron[65743]: NSSWITCH(_nsdispatch): files, passwd_compat, endpwent, not found, and no fallback provided
```


_I h_ave no c_l_ue what could cause these errors. Any hints _are_ appreciated. _The s_ystem was recently upgraded, but _I_ cannot tell if this is related to this problem.


----------



## Erratus (Jul 7, 2013)

_I f_orgot how I fixed other systems before:

```
# cat /etc/nsswitch.conf
#
# nsswitch.conf(5) - name service switch configuration file
# $FreeBSD: src/etc/nsswitch.conf,v 1.3.2.1.4.2 2012/11/17 08:47:00 svnexp Exp $

# as there is no NIS server on this domain, NIS is commented out here after
# logfiels have been full of nis errors 2013/06/03

#group: compat
#group: nis [notfound=return] files
group: files
#group_compat: nis
group_compat: files
hosts: cache files dns
networks: files
#passwd: compat
#passwd: nis [notfound=return] files
passwd: files
#passwd_compat: nis
passwd_compat: files
shells: files
services: compat
#services_compat: nis
services_compat: files
protocols: files
rpc: files
```

@fonz: thanks for teaching native English. _I was w_ondering where ressources go to.


----------



## kpa (Jul 7, 2013)

Remove the compat entries if you're not using NIS. This is what my /etc/nsswitch.conf looks like on a system that is compiled with WITHOUT_NIS=1:


```
#
# nsswitch.conf(5) - name service switch configuration file
# $FreeBSD: stable/9/etc/nsswitch.conf 224765 2011-08-10 20:52:02Z dougb $
#
group: files
hosts: files mdns_minimal [NOTFOUND=return] dns mdns
networks: files
passwd: files
shells: files
services: files
protocols: files
rpc: files
```

The only thing that the _compat entries do is to add support +/- fields for passwd and group (I think also services but never seen it used). Also the nsswitch.conf(5) manual page states the if you use a compat entry for any source it has to be the only entry for the source. So what you have is actually an error:


```
group: files
#group_compat: nis
group_compat: files
```

It should be like this if you want to keep the compat entry:


```
group: compat
group_compat: nis
```

But like I said it's easier to just remove the compat entry and use files directly.


----------



## Erratus (Jul 8, 2013)

Thanks for comments on the use of compat!


----------

