ntpd seems to ignore "disable kernel" directive in ntp.conf

Asked by Viktor Trojanovic on 2019-01-08

The directive "disable kernel" in /etc/ntp.conf should, per my understanding, stop ntpd from adjusting the system clock using ntp_adjtime calls.

On Ubuntu Bionic LTS with ntpd v4.2.8p10, these directives seem to be ignored as the debug output of ntpd -d shows:

# ntpd -d
 8 Jan 21:30:51 ntpd[10906]: ntpd 4.2.8p10@1.3728-o (1): Starting
 8 Jan 21:30:51 ntpd[10906]: Command line: ntpd -d
 8 Jan 21:30:51 ntpd[10906]: Cannot set RLIMIT_MEMLOCK: Operation not permitted
 8 Jan 21:30:51 ntpd[10906]: proto: precision = 0.115 usec (-23)
Finished Parsing!!
newpeer:> mode 3 vers 4 poll 3 3 flags 0x29 0x1 ttl 0 key 00000000
 8 Jan 21:30:51 ntpd[10906]: start_kern_loop: ntp_loopfilter.c line 1119: ntp_adjtime: Operation not permitted
event at 0 c01d 0d kern kernel time sync enabled
 8 Jan 21:30:51 ntpd[10906]: set_freq: ntp_loopfilter.c line 1082: ntp_adjtime: Operation not permitted
event at 0 c012 02 freq_set ntpd 0.000 PPM

The output shows that ntp_adjtime is called in spite of the "disable kernel" directive in /etc/ntp.conf. Is this expected behavior?

Background: I'm running ntpd in a container. While it should serve time to other machines, it should not manipulate the system clock as the clock is managed by the container host.

Question information

English Edit question
Ubuntu ntp Edit question
No assignee Edit question
Last query:
Last reply:

I suggest you report a bug

Can you help with this problem?

Provide an answer of your own, or ask Viktor Trojanovic for more information if necessary.

To post a message you must log in.