You are not logged in.

#1 2009-10-24 09:15:51

Llama
Banned
From: St.-Petersburg, Russia
Registered: 2008-03-03
Posts: 1,379

openntpd won't ajdust my clock any more

Hi,

It's been happening on one of my Arh boxes (laptop) for a while (a couple of weeks). I checked this; no help. Nothing at all in the logs; ntpd -s -d output even mentioned a reasonable looking correction, but the clock still runs about 25 seconds ahead of time.

NB: After a while I've aborted ntpd (started from console). I've got a gut feeling that it hadn't been proper management... Any ideas?

Last edited by Llama (2009-10-24 09:37:24)

Offline

#2 2009-10-24 10:06:18

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: openntpd won't ajdust my clock any more

I couldn't get openntpd to work on my box either, I use the ntpd package.

/etc/ntpd.conf

server pool.ntp.org

driftfile    /var/lib/ntp/ntp.drift

restrict default nomodify nopeer
restrict 127.0.0.1

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2009-10-24 10:16:51

Llama
Banned
From: St.-Petersburg, Russia
Registered: 2008-03-03
Posts: 1,379

Re: openntpd won't ajdust my clock any more

graysky wrote:

I couldn't get openntpd to work on my box either, I use the ntpd package.

Thanks! If push comes to shove, I'll try ntpd too. Funny thing, until recently openntpd worked just fine, for quite some time.

Offline

#4 2009-10-24 10:21:11

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Re: openntpd won't ajdust my clock any more

Have a look at, for example: http://bbs.archlinux.org/viewtopic.php?id=66522
I gave up on openntpd when problems arose during the summer after some upgrades, and I'm now using ntp very successfully. Only problem was to delay starting of the ntpd daemon until wicd got my network up and running.
So I created the daemon file:

#!/bin/bash
# delayd : Meta-daemon to run daemons after delay
sleep 25
/etc/rc.d/ntpd start

and load it in /etc/rc.conf thus:

DAEMONS=(... @delayd ...)

Offline

#5 2009-10-24 10:46:35

Llama
Banned
From: St.-Petersburg, Russia
Registered: 2008-03-03
Posts: 1,379

Re: openntpd won't ajdust my clock any more

Thanks!

Offline

#6 2009-10-25 08:38:41

Llama
Banned
From: St.-Petersburg, Russia
Registered: 2008-03-03
Posts: 1,379

Re: openntpd won't ajdust my clock any more

ninian, what does happen if ntpd starts without delay?


ntpd works indeed on my laptop. Curiously, openntpd on another box keeps on working properly. It's a big box with a simple /etc/rc.conf network configuration, while the bad thing happens on the laptop (Wi-Fi, wicd).

UPD:

NetworkManager solutions for KDE 4.x (just for reference)

/etc/NetworkManager/dispatcher.d/myntp

#!/bin/bash

case "$2" in
        up)
                if [ /etc/rc.d/ntpd ]; then
                   /etc/rc.d/ntpd start
                fi
        ;;
        down)
                if [ /var/run/daemons/ntpd ]; then
                        /etc/rc.d/ntpd stop
                fi
        ;;
esac

/etc/NetworkManager/dispatcher.d/myopenntp

#!/bin/bash

CONF=/etc/conf.d/openntpd

. /etc/rc.conf
. /etc/rc.d/functions

[ -f $CONF ] && . $CONF

PID=`pidof -o %PPID /usr/sbin/ntpd`
case "$2" in
  up)
    stat_busy "Starting OpenNTPD"
    [ -z "$PID" ] && /usr/sbin/ntpd $PARAMS
    if [ $? -gt 0 ]; then
      stat_fail
    else
      PID=`pidof -o %PPID /usr/sbin/ntpd`
      echo $PID >/var/run/openntpd.pid
      add_daemon openntpd
      stat_done
    fi
    ;;
  down)
    stat_busy "Stopping OpenNTPD"
    [ ! -z "$PID" ]  && kill $PID &>/dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon openntpd
      stat_done
    fi
    ;;
  *)
    echo "usage: $0 {up|down}" 
esac
exit 0

Last edited by Llama (2010-05-13 15:10:53)

Offline

#7 2009-10-25 11:07:15

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: openntpd won't ajdust my clock any more

Llama wrote:

ninian, what does happen if ntpd starts without delay?


ntpd works indeed on my laptop. Curiously, openntpd on another box keeps on working properly. It's a big box with a simple /etc/rc.conf network configuration, while the bad thing happens on the laptop (Wi-Fi, wicd).

If it starts before wicd it will fail to resolve the name of the ntp servers because there is no network, it will remove the servers from the list of servers and it will not work, I had the same problem.

My solution was to make a static association in /etc/hosts, ntpd will fail to contact the servers but it can resolve the name so it will keep trying to contact them until there is network, which should be a few seconds later after wicd starts.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#8 2009-10-25 11:16:52

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: openntpd won't ajdust my clock any more

ninian wrote:

Only problem was to delay starting of the ntpd daemon until wicd got my network up and running.

Openntpd is working OK for me so I stayed with it. However, to get around the network start delay I removed openntpd from rc.conf daemons and put the following in the wicd connection (properties->scripts->post connection script)

/etc/rc.d/openntpd start

You can also do this with multiple daemons starters e.g.

/etc/rc.d/openntpd start && /etc/rc.d/dnsmasq start

Offline

#9 2009-10-25 13:07:21

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Re: openntpd won't ajdust my clock any more

R00KIE wrote:

If it starts before wicd it will fail to resolve the name of the ntp servers because there is no network, it will remove the servers from the list of servers and it will not work, I had the same problem.

My solution was to make a static association in /etc/hosts, ntpd will fail to contact the servers but it can resolve the name so it will keep trying to contact them until there is network, which should be a few seconds later after wicd starts.

vacant wrote:

Openntpd is working OK for me so I stayed with it. However, to get around the network start delay I removed openntpd from rc.conf daemons and put the following in the wicd connection (properties->scripts->post connection script)

Thank you both for replying and for giving your own interesting solutions which I hadn't thought of.
10/10 for the usefulness of the Arch forums again! lol

Offline

Board footer

Powered by FluxBB