Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   ntpd crashes. (http://www.linux-archive.org/debian-user/701682-ntpd-crashes.html)

lee 01-01-1970 01:00 AM

ntpd crashes.
 
Mauro <mrsanna1@gmail.com> writes:

> PROBLEM!!!!!!
> System clock is gone one hour ahead, ntp stops to run with no messages
> logs and I now I'm in trouble because I don't know what to do.

Try the program below and see what it says. If it actually tells you
that the time is out of sync, you can write a script around it that
checks the exit code, restores system time from hardware time (if the
hardware time isn't off, too) or with ntpdate, restarts your NTP daemon
if needed and the program. It won't keep your time from jumping and
only would make it jump back right away. It's ugly, yet better than
nothing.

If it doesn't tell you that the time is out of sync when it is, I would
wonder why the kernel doesn't know about it ...

My system time doesn't jump and I don't want it to, so I can only say
that the program runs and that the return value of adjtimex() indicates
that the time is ok.


You could also try to use ntpdate with the -q or -d option to get time
from an external reference, verify that with the system time and do
something when the system time is suddenly off.

What's in the configuration of your NTP daemon? Perhaps there's
something wrong with that.


// this software is licensend under the GPL
// written by lee@yun.yagibdah.de, 2012-09-26
// compile with something like:
// gcc -Wall -O2 timetellbad.c -o timetellbad
//
// supposed to print a message to stdout, then exit with code 2 when the
// kernel figures the time is out of sync --- checks every TICK seconds
//


#include <stdio.h>
#include <sys/timex.h>
#include <unistd.h>


// sleep 5 seconds between checks
#define TICK 5


int main(int argc, char *argv[] ) {

struct timex tx;
int cstate;

tx.modes = 0;

while(1) {

cstate = adjtimex( &tx);

if( cstate == -1) {
perror("error");
return 1;
}
else {
if( cstate == TIME_BAD) {
puts("time is out of sync, exiting");
return 2;
}
}

sleep(TICK);
}

return 0;
}


--
Debian testing amd64


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87ipb0ga3l.fsf@yun.yagibdah.de">http://lists.debian.org/87ipb0ga3l.fsf@yun.yagibdah.de

Mauro 09-08-2012 11:31 AM

ntpd crashes.
 
Hello I've two server with debian squeeze and in cluster with
heartbeat+pacemaker.
They run ntpd for time synchronize.
I've noticed some ntpd crashes in random days and random hour.
Logs don't say why.
Can you suggest what can I do to know the reasons for the crash.
Thank you.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CAE17a0XZLGAe16Gpk5vc5q2mJz=5zBMrxfmr19KHYwzPmZZEY g@mail.gmail.com

Camaleón 09-09-2012 05:52 PM

ntpd crashes.
 
On Sat, 08 Sep 2012 13:31:16 +0200, Mauro wrote:

> Hello I've two server with debian squeeze and in cluster with
> heartbeat+pacemaker.
> They run ntpd for time synchronize.
> I've noticed some ntpd crashes in random days and random hour.

Does restarting the service works?

> Logs don't say why.
> Can you suggest what can I do to know the reasons for the crash. Thank
> you.

Mmmm... there's a bug report¹ to request ntpd debugging flag is turned on
(which I think is a must) but in the meantime I guess you will have to
recompile the package from Debian sources and toggle this parameter on if
you want to get an insightful trace.

¹http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=643954

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/k2il0h$rra$12@ger.gmane.org

Camaleón 09-10-2012 05:12 PM

ntpd crashes.
 
El 2012-09-09 a las 22:20 +0200, Mauro escribió:

(resending to the list)

> On 9 September 2012 19:52, Camaleón <noelamac@gmail.com> wrote:
> > On Sat, 08 Sep 2012 13:31:16 +0200, Mauro wrote:
> >
> >> Hello I've two server with debian squeeze and in cluster with
> >> heartbeat+pacemaker.
> >> They run ntpd for time synchronize.
> >> I've noticed some ntpd crashes in random days and random hour.
> >
> > Does restarting the service works?
>
> Yes.

Mmm, so it dies "gracefully" :-?

> >> Logs don't say why.
> >> Can you suggest what can I do to know the reasons for the crash. Thank
> >> you.
> >
> > Mmmm... there's a bug report¹ to request ntpd debugging flag is turned on
> > (which I think is a must) but in the meantime I guess you will have to
> > recompile the package from Debian sources and toggle this parameter on if
> > you want to get an insightful trace.
>
> Yes I know and to me it is a very strange choice to have ntp debian
> package without debugging flag.

Apparently, the option was removed because of an old bug, but I agree it
should be enabled as soon as possible.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120910171254.GA7986@stt008.linux.site">http://lists.debian.org/20120910171254.GA7986@stt008.linux.site

Gerald Turner 09-10-2012 10:08 PM

ntpd crashes.
 
Camaleón <noelamac@gmail.com> writes:

> On Sat, 08 Sep 2012 13:31:16 +0200, Mauro wrote:
>
>> Hello I've two server with debian squeeze and in cluster with
>> heartbeat+pacemaker.
>> They run ntpd for time synchronize.
>> I've noticed some ntpd crashes in random days and random hour.
>
> Does restarting the service works?
>
>> Logs don't say why.
>> Can you suggest what can I do to know the reasons for the crash. Thank
>> you.
>
> Mmmm... there's a bug report¹ to request ntpd debugging flag is turned
> on (which I think is a must) but in the meantime I guess you will have
> to recompile the package from Debian sources and toggle this parameter
> on if you want to get an insightful trace.
>
> ¹http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=643954

I too get random crashes with ntpd in squeeze (1:4.2.6.p2+dfsg-1+b1) on
a Xen dom0 host. Frequency is about every two months. It prompted me
to install monit² which has nice support for probing NTP protocol and
restarting the service automatically - not a perfect solution since the
clock jumps forward an hour during the breakage, upsetting lots of
software (dovecot and RRD graphs mostly).

There is a bug report³ that defines our situation exactly: ntpd exits
randomly with no messages in syslog.

Thanks Camaleón for the idea to rebuild with debug - I'll try that next
time around :)

² http://packages.debian.org/squeeze/monit
³ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594071

--
Gerald Turner Email: gturner@unzane.com JID: gturner@unzane.com
GPG: 0xFA8CD6D5 21D9 B2E8 7FE7 F19E 5F7D 4D0C 3FA0 810F FA8C D6D5

Mauro 09-11-2012 06:44 AM

ntpd crashes.
 
On 11 September 2012 00:08, Gerald Turner <gturner@unzane.com> wrote:
> Camaleón <noelamac@gmail.com> writes:
>
>> On Sat, 08 Sep 2012 13:31:16 +0200, Mauro wrote:
>>
>>> Hello I've two server with debian squeeze and in cluster with
>>> heartbeat+pacemaker.
>>> They run ntpd for time synchronize.
>>> I've noticed some ntpd crashes in random days and random hour.
>>
>> Does restarting the service works?
>>
>>> Logs don't say why.
>>> Can you suggest what can I do to know the reasons for the crash. Thank
>>> you.
>>
>> Mmmm... there's a bug report¹ to request ntpd debugging flag is turned
>> on (which I think is a must) but in the meantime I guess you will have
>> to recompile the package from Debian sources and toggle this parameter
>> on if you want to get an insightful trace.
>>
>> ¹http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=643954
>
> I too get random crashes with ntpd in squeeze (1:4.2.6.p2+dfsg-1+b1) on
> a Xen dom0 host. Frequency is about every two months. It prompted me
> to install monit² which has nice support for probing NTP protocol and
> restarting the service automatically - not a perfect solution since the
> clock jumps forward an hour during the breakage, upsetting lots of
> software (dovecot and RRD graphs mostly).

Exactly.
I too have Xen dom0 hosts where ntp crashes.
I think the best solution is uninstall ntp and use ntpdate with cron.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CAE17a0WZG7K1hKWEWdOPyVwXXZmPt18j=6v1wr8w5tQjtHpYP w@mail.gmail.com

Chris Davies 09-11-2012 08:58 AM

ntpd crashes.
 
Mauro <mrsanna1@gmail.com> wrote:
> I think the best solution is uninstall ntp and use ntpdate with cron.

Not a particularly good solution for a number of reasons. Mainly, though,
you need to be aware that ntpdate is quite likely to jump the clock.

Chris


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 62b3i9xl5c.ln2@news.roaima.co.uk">http://lists.debian.org/62b3i9xl5c.ln2@news.roaima.co.uk

Mauro 09-11-2012 10:54 AM

ntpd crashes.
 
On 11 September 2012 10:58, Chris Davies <chris-usenet@roaima.co.uk> wrote:
> Mauro <mrsanna1@gmail.com> wrote:
>> I think the best solution is uninstall ntp and use ntpdate with cron.
>
> Not a particularly good solution for a number of reasons. Mainly, though,
> you need to be aware that ntpdate is quite likely to jump the clock.

If ntp stops running with apparently no reasons I don't know what else I can do.
I need to have time synchronized between my servers.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAE17a0XEiT6qthG3ewN+uHEGU73p71PVc-Ns6HQB1dvjERzGXw@mail.gmail.com">http://lists.debian.org/CAE17a0XEiT6qthG3ewN+uHEGU73p71PVc-Ns6HQB1dvjERzGXw@mail.gmail.com

Ralf Mardorf 09-11-2012 11:03 AM

ntpd crashes.
 
On Tue, 2012-09-11 at 12:54 +0200, Mauro wrote:
> On 11 September 2012 10:58, Chris Davies <chris-usenet@roaima.co.uk> wrote:
> > Mauro <mrsanna1@gmail.com> wrote:
> >> I think the best solution is uninstall ntp and use ntpdate with cron.
> >
> > Not a particularly good solution for a number of reasons. Mainly, though,
> > you need to be aware that ntpdate is quite likely to jump the clock.
>
> If ntp stops running with apparently no reasons I don't know what else I can do.
> I need to have time synchronized between my servers.

I'm a ntpdate and sntp user. I never had issues using ntpdate and sntp
manually. I don't sync the clock by a cron job. Does "jump the clock"
mean that the time is synced hard, ignoring timestamps?



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/1347361420.1250.23.camel@localhost.localdomain

Camaleón 09-11-2012 02:48 PM

ntpd crashes.
 
On Tue, 11 Sep 2012 12:54:59 +0200, Mauro wrote:

> On 11 September 2012 10:58, Chris Davies <chris-usenet@roaima.co.uk>
> wrote:
>> Mauro <mrsanna1@gmail.com> wrote:
>>> I think the best solution is uninstall ntp and use ntpdate with cron.
>>
>> Not a particularly good solution for a number of reasons. Mainly,
>> though, you need to be aware that ntpdate is quite likely to jump the
>> clock.
>
> If ntp stops running with apparently no reasons I don't know what else I
> can do. I need to have time synchronized between my servers.

You can try a different approach: do not run ntpd as daemon but using
cron and see how it goes :-?

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/k2nj0m$3ru$6@ger.gmane.org


All times are GMT. The time now is 02:43 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.