simple time server - NTP

This is a discussion on simple time server - NTP ; I want a server that simply tells clients when they ask what time it is, using the local system time. Preferably with NTP. After reading a bunch of Ntpd documentation, I thought the undisciplined local clock driver might be that, ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: simple time server

  1. simple time server

    I want a server that simply tells clients when they ask what time it
    is, using the local system time. Preferably with NTP. After reading
    a bunch of Ntpd documentation, I thought the undisciplined local clock
    driver might be that, but in experiments, it appears to be quite a bit
    more complex (judging from debug messages, its demanding superuser
    privilege, and the fact that it put my kernel in the hardware clock
    updating mode).

    Ideally, I'd like something simple enough it could even run via Inetd.

    Is there such a program available for Unix?

    --
    Bryan Henderson Phone 408-621-2000
    San Jose, California
    _______________________________________________
    questions mailing list
    questions@lists.ntp.isc.org
    https://lists.ntp.isc.org/mailman/listinfo/questions


  2. Re: simple time server

    In article <56459.bryanh@giraffe-data.com>,
    bryanh@giraffe-data.com (Bryan Henderson) wrote:

    > more complex (judging from debug messages, its demanding superuser
    > privilege, and the fact that it put my kernel in the hardware clock
    > updating mode).


    It needs root privileges to bind to port 123 and to be able to set the
    clock, when acting as a client.

    > Ideally, I'd like something simple enough it could even run via Inetd.


    > Is there such a program available for Unix?


    Yes. inetd, itself!

    port 13 will give you the kernel's wall clock time in ASCII and
    port 37 will give the UTC time in Unix internal binary format.

    Note these only have one second resolution, but if you were expecting to
    have to start a program everytime, you weren't particularly interested in
    high accuracy.

    Vendors often disable these on the basis that you disable all ports
    and then enable those that are actually used.

    Note that using the undisciplined local clock on ntpd, except as a last
    resort fall back, is generally frowned upon.

  3. Re: simple time server

    Bryan Henderson wrote:

    > I want a server that simply tells clients when they ask what time it
    > is, using the local system time. Preferably with NTP. After reading
    > a bunch of Ntpd documentation, I thought the undisciplined local clock
    > driver might be that, but in experiments, it appears to be quite a bit
    > more complex (judging from debug messages, its demanding superuser
    > privilege, and the fact that it put my kernel in the hardware clock
    > updating mode).
    >
    > Ideally, I'd like something simple enough it could even run via Inetd.
    >
    > Is there such a program available for Unix?
    >



    NTP is a very poor choice for what you want to do. It does not deal
    with local time at all, it's UTC all the way.

    Have you considered using rdate? See man rdate.

    If you are willing to configure your systems properly you can use NTP.
    The clock will keep UTC but the systems will display the local time for
    the time zone you set. If you have already configured the proper
    timezone the clock is actually keeping UTC not local time.

    You might find it simpler to use SNTP on the clients.

  4. Re: simple time server

    On 2006-08-01, Bryan Henderson wrote:

    > I want a server that simply tells clients when they ask what time it
    > is,


    Merely emitting a time stamp does not account for propagation delays,
    TCP overhead, etc.

    >using the local system time.


    That presupposes that both your clients and servers are located in the
    same time-zone.

    > Preferably with NTP.


    NTP provides you with a way of synchronizing your clocks and
    continuously disciplines them to control the drift.

    rdate, on the other hand, merely adjusts your clock (by stepping or
    intiating a slew) each time it is run.

    > After reading a bunch of Ntpd documentation, I thought the
    > undisciplined local clock driver might be that, but in experiments, it
    > appears to be quite a bit more complex (judging from debug messages,
    > its demanding superuser privilege,


    ntpd needs to be able to adjust the clock. This usually can only be done
    by the root user.

    > and the fact that it put my kernel in the hardware clock updating
    > mode).


    That's usually considered to be a good thing. Why don't you want it to
    happen?

    > Ideally, I'd like something simple enough it could even run via Inetd.


    You could use the time service built in to inetd (already mentioned in
    other articles).

    If you wish to use some other service, keep in mind that there will be
    some overhead: waiting for inetd to spawn the service, then determining
    the time, and then returning the time to the user.

    > Is there such a program available for Unix?


    The system clock on most Unix systems operates in UTC. Conversion to the
    desired time zone is performed by the OS.

    Can you provide any details about your application?

    --
    Steve Kostecke
    NTP Public Services Project - http://ntp.isc.org/

+ Reply to Thread