Openntpd auf FreeBSD 9.2

Guten Abend,

ich wollte auf meinem lokalen Server die Zeit automatisch synchronisieren lassen und dafür Openntpd installieren.

Allerdings funktioniert das nicht. Die Installation wird einfach gestoppt und selbst wenn ich danach make deinstall eingebe, reicht danach ein reboot damit ich überhaupt nicht mehr auf den Server zugreifen kann.

Code:
root@Gemini:~ # cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime
root@Gemini:~ # cd /usr/ports/net/openntpd/ && make install clean
=> openntpd-4.6.tgz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://anga.funkfeuer.at/ftp/pub/OpenBSD/OpenNTPD/openntpd-4.6.tgz
openntpd-4.6.tgz                              100% of  29 kB 1626 kBps
===> Fetching all distfiles required by openntpd-4.6_2,2 for building
===>  Extracting for openntpd-4.6_2,2
=> SHA256 Checksum OK for openntpd-4.6.tgz.
===>  Patching for openntpd-4.6_2,2
===>  Applying FreeBSD patches for openntpd-4.6_2,2
===>  Configuring for openntpd-4.6_2,2
===>  Building for openntpd-4.6_2,2
/usr/bin/sed -i.bak -e 's,%%PREFIX%%,/usr/local,g'  /usr/ports/net/openntpd/work/ntpd/ntpd.h /usr/ports/net/openntpd/work/ntpd/ntpd.conf.5 /usr/ports/net/openntpd/work/ntpd/ntpd.8
Warning: Object directory not changed from original /usr/ports/net/openntpd/work/ntpd
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c ntpd.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c buffer.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c log.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c imsg.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c ntp.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c ntp_msg.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c config.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c server.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c client.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c util.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c ntp_dns.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c adjfreq.c
gzip -cn ntpd.8 > ntpd.8.gz
gzip -cn ntpd.conf.5 > ntpd.conf.5.gz
yacc  -o parse.c parse.y
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -c parse.c
cc -O2 -pipe -fno-strict-aliasing  -Wall -I/usr/ports/net/openntpd/work/ntpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -std=gnu99 -fstack-protector  -o ntpd ntpd.o buffer.o log.o imsg.o ntp.o ntp_msg.o parse.o config.o server.o client.o util.o ntp_dns.o adjfreq.o -lmd
===>  Staging for openntpd-4.6_2,2
===>  Generating temporary packing list
===> Creating users and/or groups.
install  -s -o root -g wheel -m 555 /usr/ports/net/openntpd/work/ntpd/ntpd /usr/ports/net/openntpd/work/stage/usr/local/sbin
install  -o root -g wheel -m 444 /usr/ports/net/openntpd/work/ntpd/ntpd.conf.5 /usr/ports/net/openntpd/work/stage/usr/local/man/man5
install  -o root -g wheel -m 444 /usr/ports/net/openntpd/work/ntpd/ntpd.8 /usr/ports/net/openntpd/work/stage/usr/local/man/man8
/bin/mkdir -p /usr/ports/net/openntpd/work/stage/usr/local/share/examples/openntpd
install  -o root -g wheel -m 444 /usr/ports/net/openntpd/files/ntpd.conf /usr/ports/net/openntpd/work/stage/usr/local/share/examples/openntpd
====> Compressing man pages (compress-man)
===> Staging rc.d startup script(s)
===> Correct pkg-plist sequence to create group(s) and user(s)
===>  Building package for openntpd-4.6_2,2
Creating package /usr/ports/net/openntpd/work/openntpd-4.6_2,2.tbz
Registering depends:.
Creating bzip'd tar ball in '/usr/ports/net/openntpd/work/openntpd-4.6_2,2.tbz'
===>  Installing for openntpd-4.6_2,2
===>  Checking if net/openntpd already installed
===> Creating users and/or groups.
Creating group '_ntp' with gid '123'.
Creating user '_ntp' with uid '123'.
pw: user '_ntp' disappeared during update
pkg_add: command 'if ! /usr/sbin/pw usershow _ntp >/dev/null 2>&1; then  echo "Creating user '_ntp' with uid '123'.";  /usr/sbin/pw useradd _ntp -u 123 -g 123  -c "NTP Daemon" -d /var/empty -s /usr/sbin/nologin;  else echo "Using existing user '_ntp'."; fi' failed
etc/rc.d/openntpd: Could not unlink
tar: Error exit delayed from previous errors.
pkg_add: leave_playpen: can't chdir back to ''
*** Error code 2

Stop in /usr/ports/net/openntpd.

Ich hab das ganze nun mehrmals ausprobiert. Ich hab auch FreeBSD schon mehrfach komplett neu installiert und vorher alles deinstalliert. Aber selbst auf einer ganz frischen 9.2-Installation (mit 8.4 hab ich es auch probiert, ist das selbe) kommt immer nur oben erwähntes.

Und wenn ich nach einem reboot nochmal versuche per SSH auf den Server zuzugreifen erhalte ich nur diese Meldung, nachdem ich den Loginnamen eingegegeben habe:

"Server unexpectedly closed network connection"

Weiss jemand, warum das nicht funktioniert bzw. wo das Problem genau ist und wie ich es beheben kann?
 
Code:
...
===> Creating users and/or groups.
Creating group '_ntp' with gid '123'.
Creating user '_ntp' with uid '123'.
pw: user '_ntp' disappeared during update
...

Das sieht doch auf Anhieb interessant aus. :) Eine mögliche Ursache könnte sein, dass /etc/passwd und /etc/master.passwd nicht zusammenpassen.
 
Wie sieht deine nsswitch.conf aus?


Code:
#
# nsswitch.conf(5) - name service switch configuration file
# $FreeBSD: release/9.2.0/etc/nsswitch.conf 224765 2011-08-10 20:52:02Z dougb $
#
group: compat
group_compat: nis
hosts: files dns
networks: files
passwd: compat
passwd_compat: nis
shells: files
services: compat
services_compat: nis
protocols: files
rpc: files
 
Ich dachte ntpdate synchronisiert nur bei Systemneustart?
Es soll aber die Zeit regelmäßig synchronisiert werden unabhängig davon, ob der Server neugestartet wird oder nicht.

Mal abgesehen davon, dass ich wenn ich dem Problem nur ausweiche nichts lerne. Ich kann ja nicht jedesmal, wenn ich ein Problem mit irgendeiner Software habe, eine Alternativsoftware benutzen.
 
Hi G...h,
ich glaube h^2 hat sich da nur vertan und wollte auf den ntp-server hinweisen der in FreeBSD integriert ist. Den musst du nur einschalten:)
Mir scheint es könnte an der Erstellung des USER /GROUP '_ntp' liegen. Leg den doch mal vor der INstallation mit uid/gid '123' an und schau was passiert.
 
Wenn du nur die Zeit bei dir anpassen willst, wieso nutzt du dann nicht einfach ntpdate aus der base?
Ein Unterschied ist, dass du bei "OpenNTPd" sagen kannst, auf welchem Interface er laufen soll. Das kannst du mit "ntpdate" nicht. Der läuft immer auf allen Interfaces.
 
Ich hatte genau das gleich Problem eben in einem Jail unter 9.2-RELEASE.

etc/rc.d/openntpd: Could not unlink
Hmmm...

Ursache war, dass /usr/local/etc/ noch nicht existierte und OpenNTPD seine rc.d-Datei kurzerhand nach /usr/local/etc geschrieben hat! :ugly:

Ergo, die Datei löschen, stattdessen ein Verzeichnis anlegen und "make install" nochmal laufen lassen.

Nachtrag: OpenNTPD in ein Jail zu packen, war minderschlau.
 
Zuletzt bearbeitet:
Zurück
Oben