Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Nov 2019 18:39:56 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        =?UTF-8?Q?BERTRAND_Jo=c3=abl?= <joel.bertrand@systella.fr>, freebsd-hackers@freebsd.org
Subject:   Re: Strange trouble with ntpd account
Message-ID:  <9eae960b-ff99-1322-e557-ead488e3739f@grosbein.net>
In-Reply-To: <35704598-f05d-d8bb-dca8-8c57ba746ea1@systella.fr>
References:  <35704598-f05d-d8bb-dca8-8c57ba746ea1@systella.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
10.11.2019 16:28, BERTRAND Joël wrote:
> 	Hello,
> 
> 	Yesterday, I have rebooted my diskless workstation running FreeBSD
> 12.0-RELEASE-p10. I have seen that ntpd refuses to start :
> 
> root@pythagore:/etc # /etc/rc.d/ntpd start
> Starting ntpd.
> su: unknown login: ntpd
> /etc/rc.d/ntpd: WARNING: failed to start ntpd
> root@pythagore:/etc #
> 
> 	indeed :
> 
> root@pythagore:/var/db/ntp # ls -al
> total 16
> drwxr-xr-x   2 123   ntpd    512 Mar 20  2019 .
> drwxr-xr-x  22 root  wheel  1024 Oct 22 19:01 ..
> -rw-r--r--   1 root  wheel     8 Mar 20  2019 ntpd.drift
> -rw-r--r--   1 root  ntpd      4 Mar 20  2019 ntpd.pid
> 
> 	Please note user 123 instead of user ntpd.
> I have tried to create a new file and change owner to ntpd without success :
> 
> root@pythagore:/var/db/ntp # touch toto
> root@pythagore:/var/db/ntp # chown ntpd toto
> chown: ntpd: illegal user name
> 
> 	I don't understand why ntpd user is illegal as this account exists in
> /etc/master.passwd :
> # $FreeBSD: releng/12.0/etc/master.passwd 337882 2018-08-15 23:18:34Z brd $
> #
> root:$6$mNlwOa.XAsUQF0bo$RCxDWSK0Hc2HGWkT5f46R6zjRhfgKhiA8IGKbM9KkILUACC0fLnKf3jABGiHSxRLSJH/.SXXsjaZJi30.CGR21:0:0::0:0:Charlie
> &:/root:/bin/csh
> toor:*:0:0::0:0:Bourne-again Superuser:/root:
> daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
> ...
> www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
> ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin

The system does not use text file /etc/master.passwd but binary files /etc/pwd.db and /etc/swd.db
and yours are out-of-sync with master.passwd for some reason.

Just re-generate binary files from /etc/master.passwd and pwd_mkdb(8) manual page's
EXAMPLE section suggests:

/usr/sbin/pwd_mkdb -p /etc/master.passwd





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9eae960b-ff99-1322-e557-ead488e3739f>