• Re: [External] : Re: Aborting ntpd when unable to control the clock

    From Brian Utterback via questions Mailing List@questions@lists.ntp.org to questions on Fri Nov 15 14:03:05 2024
    From Newsgroup: comp.protocols.time.ntp

    --------------AfEcBvlq5rFiTPGj2jj3RC0c
    Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit

    Solaris also has a monitor mode for NTP. When that mode is invoked, we explicitly drop the privilege needed to adjust the clock. Another
    situation is if ntpd is run in a Solaris zone (similar to a Linux
    container). By default these zones don't have the privilege needed to
    set the clock.  In a perfect world, ntpd would exit abnormally with an
    error message when it is run in a zone without the priv to set the clock
    and when run in monitor mode, the ntp.conf file would always contain
    "disable ntp". However, I can't control what the admin puts into the
    ntp.conf file. Further, it can be convenient to be able to switch
    between the two modes without  having to change the ntp.conf file.

    What we actually do is report the error once the first time, and if it persists, stop trying to set the clock. When in monitor mode, we set an environment variable to suppress reporting the error the first time.

    That being said, I am sure I can work around whatever you put into the
    code, as I am doing now. Indeed, perhaps a better approach would be to
    set "disable ntp" when ntpd sees the environment variable.


    On 11/14/2024 3:49 AM, Dave Hart wrote:

    On Thu, Nov 14, 2024 at 7:04 AM Harlan Stenn <stenn@nwtime.org> wrote:

    To be clear, deciding when ntpd should abort if it cannot
    discipline the
    clock should be done at the "right" place in the code - not too
    early,
    and not too late.


    Well, Goldilocks, it seems obvious to me -- when an attempt to modify
    the system time/clock rate fails.

    Cheers,
    Dave Hart

    --
    --
    I haven't lost my mind, it is backed up in the cloud somewhere.

    Oracle <http://www.oracle.com>
    Brian Utterback, Principal Software Engineer
    Phone: +16038973049 <tel:+16038973049>, Mobile: +16035577683 <tel:+16035577683>
    https://oracle.zoom.us/s/2728168892
    One Oracle Drive, Nashua, NH 03062

    --------------AfEcBvlq5rFiTPGj2jj3RC0c
    Content-Type: multipart/related;
    boundary="------------XuGIJiSdHYVEpWmHMdkdefPH"

    --------------XuGIJiSdHYVEpWmHMdkdefPH
    Content-Type: text/html; charset=UTF-8
    Content-Transfer-Encoding: 8bit

    <!DOCTYPE html><html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body>
    Solaris also has a monitor mode for NTP. When that mode is invoked,
    we explicitly drop the privilege needed to adjust the clock. Another
    situation is if ntpd is run in a Solaris zone (similar to a Linux
    container). By default these zones don't have the privilege needed
    to set the clock.&nbsp; In a perfect world, ntpd would exit abnormally
    with an error message when it is run in a zone without the priv to
    set the clock and when run in monitor mode, the ntp.conf file would
    always contain &quot;disable ntp&quot;. However, I can't control what the
    admin puts into the ntp.conf file. Further, it can be convenient to
    be able to switch between the two modes without&nbsp; having to change
    the ntp.conf file. <br>
    <br>
    What we actually do is report the error once the first time, and if
    it persists, stop trying to set the clock. When in monitor mode, we
    set an environment variable to suppress reporting the error the
    first time. <br>
    <br>
    That being said, I am sure I can work around whatever you put into
    the code, as I am doing now. Indeed, perhaps a better approach would
    be to set &quot;disable ntp&quot; when ntpd sees the environment variable. <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 11/14/2024 3:49 AM, Dave Hart wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CAMbSiYBwjOkQsUNdUT0J0_7xFRZOwjgCCufU8QFDRSYMQ2FUEA@mail.gmail.com">

    <div dir="ltr"><br>
    <div class="gmail_quote">
    <div dir="ltr" class="gmail_attr">On Thu, Nov 14, 2024 at
    7:04 AM Harlan Stenn &lt;<a href="mailto:stenn@nwtime.org" moz-do-not-send="true" class="moz-txt-link-freetext">stenn@nwtime.org</a>&gt;
    wrote:<br>
    </div>
    <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">To
    be clear, deciding when ntpd should abort if it cannot
    discipline the <br>
    clock should be done at the &quot;right&quot; place in the code - not
    too early, <br>
    and not too late.<br>
    </blockquote>
    <div><br>
    </div>
    <div class="gmail_default" style="font-family:&quot;trebuchet ms&quot;,sans-serif">Well,
    Goldilocks, it seems obvious to me -- when an attempt to
    modify the system time/clock rate fails.</div>
    <div>
    <div dir="ltr" class="gmail_signature">
    <div dir="ltr">
    <div><font face="tahoma, sans-serif" color="#666666"><br>
    </font></div>
    <font face="tahoma, sans-serif" color="#666666">Cheers,<br>
    Dave Hart</font></div>
    </div>
    </div>
    <br class="gmail-Apple-interchange-newline">
    </div>
    </div>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
    -- <br>
    <font color="#666666" face="Verdana, Arial, Helvetica, sans-serif" size="2">I haven't lost my mind, it is backed up in the cloud
    somewhere.</font>
    <p><font color="#666666" face="Verdana, Arial, Helvetica, sans-serif" size="2"></font>
    <a href="http://www.oracle.com" target="_blank"><img src="cid:part1.W1HLnCq1.9YoAz4nf@oracle.com" alt="Oracle" width="114" height="26" border="0"></a><br>
    <font color="#312D2A" size="2" face="Oracle Sans, Verdana, Arial, Helvetica, sans-serif">Brian
    Utterback, Principal Software Engineer<br>
    Phone: <a href="tel:+16038973049" moz-do-not-send="true">+16038973049</a>,
    Mobile: <a href="tel:+16035577683" moz-do-not-send="true">+16035577683</a>
    <br>
    <a href="https://oracle.zoom.us/s/2728168892" moz-do-not-send="true" class="moz-txt-link-freetext">https://oracle.zoom.us/s/2728168892</a><br>
    One Oracle Drive, Nashua, NH 03062</font>
    <br>
    <!-- This signature was generated by the MyDesktop Oracle Business Signature utility version 7.0.200 -->
    <!-- Sent through Thunderbird on my laptop -->
    </p>
    </div>
    </body>
    </html>
    --------------XuGIJiSdHYVEpWmHMdkdefPH
    Content-Type: image/png; name="oracle-signature.png"
    Content-Disposition: inline; filename="oracle-signature.png"
    Content-Id: <part1.W1HLnCq1.9YoAz4nf@oracle.com>
    Content-Transfer-Encoding: base64

    iVBORw0KGgoAAAANSUhEUgAAAdsAAABtCAMAAADeQDvaAAAAM1BMVEX////HRjTHRjTHRjTHRjTH RjTHRjTHRjTHRjTHRjTHRjTHRjTHRjTHRjTHRjTHRjTHRjRvzzViAAAAEHRSTlMAQBAgMKDA8JBQ gNBgsHDg4F7WEgAAAAFv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f9ORdOGibXaJkEzdr zHBwLAt532me8v4tWQsVLh268E9KTddWzN4EuGwZ9mwnlcgS1KMy9ZbnIRb+CXV1qIVzp2LuX7rx ggdTGm8g4OCjbW6fgyVaJiHIoIgW0yQQl5Mntk32QGSKs9eHA63pArAn/cRpaAi4w2WrP7fPcTZM E/TujKH17lOagYC+pK6mhq6FpG/uJBuPTV75KhOg4tOnjIOQOU76scvttl3mrqtoMXXdtWfWHijv Xlkv1eW6CHENDoezWhv2ZjgJWxDGETDM5xoCxJ4tusrxxCdib/2103kT/TVkArAqtbVwZC10Y+Ma bEqNb8ycr3chYKVWp8F9cdHmfDjAwjFncbMBV13nSMNl5ut4Ym7emOOvwbAS8PDAdm2vvJG3AtHm Km7uS+trWOllqGTmt91rLh4xMRJw9NF2m6SN4mYbA063J/+ATJMt9cmE4zyiwuor1itnvnlTrdIz nrNq+94d0F8L+8UYvPrC3hw0vG2qPSfBEL7SHv/ZvAEOOmQgYFthW7UFltpcCApAUwNHl9uxuZxD 27kCErTCTFEWZqjWBswW0uNz9e3Y20u51rIp/3eCEIKoW3uDzfI3nhkhkw2IqMSCxRaI50yUBLym t6T6+QvZqkBpa8K2bzL+oxEhodN6Hohewr5FVHiu1B49lGvRVQSAFbZ65P+AWmqnaU8MQQz/IGjs pSx781kvunp/DI0kXDzXCrkWXUMA6IZlZcpWfLX/g6DdEOQ0KeQdLztZuvZzfLSM6n6DJv7UUAGz 69pPU1PkgaY3w/99EJhJa5u8pRDkeJ7LJ+3eV3/P6/6+2CrWR8sglW3TzwSEYEih45bozaupqycA /zhd22vG79iLHU7rXNuMvYA+EAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQC gUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBP4T+Ac9bumbta5LSQAAAABJRU5ErkJg gg==

    --------------XuGIJiSdHYVEpWmHMdkdefPH--

    --------------AfEcBvlq5rFiTPGj2jj3RC0c--

    --- Synchronet 3.20a-Linux NewsLink 1.114