coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#682969: timeout 20 /usr/sbin/ntpd -g -q gives wrong return code


From: Jim Meyering
Subject: Re: Bug#682969: timeout 20 /usr/sbin/ntpd -g -q gives wrong return code
Date: Fri, 27 Jul 2012 18:56:39 +0200

Goswin von Brederlow wrote:
> Package: coreutils
> Version: 8.13-3.2
> Severity: normal
> File: /usr/bin/timeout
>
> I'm trying to set the time during boot. Unfortunately ntpd hangs forever
> if the timeserver is unavailable. So I added a timeout to it so the
> system still continues to boot without the correct time.
>
> But I would like to log the error. Timeout is supposed to return 124 if the
> time was exceeded. But if ntpd corrects the time by more than the timeout
> then the return value is 124 despite the fact the real time passed was less.
>
> Wouldn't it be possible to detect this case and return the exit code of
> ntpd instead of a false timeout error?

Thanks for the report.
Did you experience an actual problem?

When I try to trigger such misbehavior, timeout seems to work fine
on a system (Fedora 17) with a working timer_settime function:

    $ timeout 2 date --set=$(LC_ALL=C date -d 10\ sec +@%s); echo $?
    0

I.e., when timeout's child terminates, the clock says
10 seconds have elapsed, yet it exits 0, because the
duration was less than 2 seconds.

I'm using the timeout from coreutils-8.17, but nothing
has changed in this area since before 8.13.

I even rebuilt my timeout binary, simulating no timer_settime
function so that it would take the alarm-using path.  Same result.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]