nsswitch.conf <-> WITHOUT_NIS

From: Ed Schouten <ed_at_80386.nl>
Date: Thu, 4 Aug 2011 19:30:56 +0200
Hi folks,

I just noticed cron doesn't work nicely when running a system built
without NIS, since it won't allow you to send emails:

| Aug  4 09:45:00 palm postfix/sendmail[12217]: fatal: www(80): No recipient addresses found in message header
| Aug  4 10:45:00 palm postfix/sendmail[12827]: fatal: www(80): No recipient addresses found in message header
| Aug  4 11:45:00 palm postfix/sendmail[13515]: fatal: www(80): No recipient addresses found in message header
| Aug  4 12:45:00 palm postfix/sendmail[14786]: fatal: www(80): No recipient addresses found in message header
| Aug  4 13:45:01 palm postfix/sendmail[15409]: fatal: www(80): No recipient addresses found in message header
| Aug  4 14:45:00 palm postfix/sendmail[18896]: fatal: www(80): No recipient addresses found in message header

According to various sources, this can be fixed by properly
configuration your nsswitch.conf. Now my question is, how should
nsswitch.conf be adjusted? The src.conf manual page says this:

	If set, you might need to adopt your nsswitch.conf(5) and remove
	‘nis’ entries.

That sort of seems to imply that you can just remove these lines:

	group_compat: nis
	passwd_compat: nis
	services_compat: nis

But on the other hand, nsswitch.conf says it will default to `nis'
anyway. So I suspect the lines shouldn't be removed, but changed to
`files', right? Maybe we should consider modifying the configuration
file accordingly?

--- etc/Makefile
+++ etc/Makefile
_at__at_ -256,6 +256,9 _at__at_ distribution:
 	    ${DESTDIR}/boot/device.hints
 .endif
 .endif
+.if ${MK_NIS} == "no"
+	sed -i "" -e 's/nis/files/' ${DESTDIR}/etc/nsswitch.conf
+.endif
 
 distrib-dirs:
 	mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/

-- 
 Ed Schouten <ed_at_80386.nl>
 WWW: http://80386.nl/

Received on Thu Aug 04 2011 - 15:30:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:16 UTC