Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Wie ntp-client beim Systemstart starten?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Sat Nov 17, 2012 2:51 pm    Post subject: Wie ntp-client beim Systemstart starten? Reply with quote

Hallo Zusammen,

wie kann ich ntp-client beim Systemstart starten lassen?

ntp-client ist im Runlevel "default",

Code:
server ~ # rc-update |grep ntp-client
           ntp-client |      default
server ~ #


jedoch bekomme ich beim Systemstart folgenden Fehler.

rc.log:
Code:
 * Setting clock via the NTP client 'ntpdate' ...
Error resolving 0.gentoo.pool.ntp.org: Name or service not known (-2)
Error resolving 1.gentoo.pool.ntp.org: Name or service not known (-2)
Error resolving 2.gentoo.pool.ntp.org: Name or service not known (-2)
Error resolving 3.gentoo.pool.ntp.org: Name or service not known (-2)
 * Failed to set clock
 [ !! ]
 * ERROR: ntp-client failed to start


Wenn das Systen "up" ist, lässt sich ntp-client anstandslos starten.

Code:
server ~ # /etc/init.d/ntp-client start
 * Setting clock via the NTP client 'ntpdate' ...           


Hat Jemand eine Idee, wie man dieses Problem lösen kann?
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Sat Nov 17, 2012 3:12 pm    Post subject: Reply with quote

Hast du an den Abhängigkeiten rum gespielt? Es sieht so aus als ob noch keine Netzwerkverbindung besteht und er deswegen die Namen nicht auflösen kann.
Back to top
View user's profile Send private message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Sat Nov 17, 2012 3:17 pm    Post subject: Reply with quote

py-ro wrote:
Hast du an den Abhängigkeiten rum gespielt? ....

Nein habe ich nicht.

Code:
server ~ # cat /etc/init.d/ntp-client
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntp-client.rc,v 1.11 2007/03/09 17:24:28 vapier Exp $

depend() {
        before cron portmap
        need net
        use dns logger
}

checkconfig() {
        if ! type "${NTPCLIENT_CMD}" >/dev/null 2>/dev/null ; then
                eerror "Please edit /etc/conf.d/ntp-client"
                eerror "Unable to locate the client command ${NTPCLIENT_CMD}!"
                return 1
        fi
        if [ -z "${NTPCLIENT_OPTS}" ] ; then
                eerror "Please edit /etc/conf.d/ntp-client"
                eerror "I need to know what server/options to use!"
                return 1
        fi
        return 0
}

start() {
        checkconfig || return $?

        ebegin "Setting clock via the NTP client '${NTPCLIENT_CMD}'"
        "${NTPCLIENT_CMD}" ${NTPCLIENT_OPTS}
        eend $? "Failed to set clock"
}
server ~ #
Back to top
View user's profile Send private message
Hollowman
Guru
Guru


Joined: 19 Apr 2007
Posts: 584

PostPosted: Sat Nov 17, 2012 4:21 pm    Post subject: Reply with quote

Hi

Kann es sein das du Networkmanager benutzt?

Sebastian
Back to top
View user's profile Send private message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Sat Nov 17, 2012 4:25 pm    Post subject: Reply with quote

Nein, Networkmanager wird nicht benutzt.
Back to top
View user's profile Send private message
demiurg
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jul 2005
Posts: 108

PostPosted: Sat Nov 17, 2012 5:50 pm    Post subject: Wie ntp-client beim Systemstart starten? Reply with quote

http://en.gentoo-wiki.com/wiki/NTP weiter unter Kapitel setting time at boot
Beim aktuellen stable ntp-4.2.6_p5-r1, welches auch bei mir installiert ist, ist ntpdate als deprecated gekennzeichnet. Meine Konfiguration

Code:
# /etc/conf.d/ntp-client

# Command to run to set the clock initially
# Most people should just leave this line alone ...
# however, if you know what you're doing, and you
# want to use ntpd to set the clock, change this to 'ntpd'
NTPCLIENT_CMD="sntp"

# Options to pass to the above command
# This default setting should work fine but you should
# change the default 'pool.ntp.org' to something closer
# to your machine.  See http://www.pool.ntp.org/ or
# try running `netselect -s 3 pool.ntp.org`.
NTPCLIENT_OPTS="-p \
   0.gentoo.pool.ntp.org"


und
Code:

# /etc/conf.d/ntpd

# Options to pass to the ntpd process
# Most people should leave this line alone ...
# however, if you know what you're doing, feel free to tweak
NTPD_OPTS=""


für eine erfolgreiches syncronisieren.
_________________
Kernel 6.xx-gentoo
GCC 12.xx
Profile amd64/17.1/desktop/plasma/systemd/merged-usr
Ryzen 5950X
GA X570 PRO BIOS F35
ATI RX6800
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4520
Location: Germany

PostPosted: Fri Nov 23, 2012 8:03 pm    Post subject: Reply with quote

3PO wrote:
Code:
depend() {
        before cron portmap
        need net
        use dns logger
}

Das wurde inzwischen geändert, nach
Code:
depend() {
        before cron portmap
        after net
        use dns logger
}

Nimm am besten ein re-emerge von net-misc/ntp vor - danach sollte es passen.

Siehe dazu zb auch im Bug 439564
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4520
Location: Germany

PostPosted: Tue Nov 27, 2012 5:25 pm    Post subject: Reply with quote

/usr/portage/net-misc/ntp/ChangeLog wrote:
11 Nov 2012; Mike Frysinger <vapier@gentoo.org> files/ntp-client.rc:
Change "need net" to "after net" #439564#5 by Diego Elio Pettenò.
Nur aus Interesse: Klappt es mit dem Änderungen im Initscript wirklich immer noch nicht?
Back to top
View user's profile Send private message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Tue Nov 27, 2012 6:05 pm    Post subject: Reply with quote

Josef.95 wrote:
Nur aus Interesse: Klappt es mit dem Änderungen im Initscript wirklich immer noch nicht?

Mittlerweile funktioniet es, leider aber weiss ich nicht mehr genau, welche Änderung nun wirklich das Problem gefixt hat... :oops:
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3921
Location: Hamburg

PostPosted: Sat Dec 01, 2012 9:45 pm    Post subject: Reply with quote

"need net" habe ich auch (noch) - und bei mir läufts.
Aber die Fehlermeldung weist eindeutig auf fehlende Namesnauflösung hin, evtl. auch ein timing-problem, wo das Netzwerkscript schon ein ok zurückmeldet, aber der Verbindungsaufbau doch noch nicht für alle Interface abgeschlossen ist ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum