OPNsense Forum

English Forums => General Discussion => Topic started by: muchacha_grande on December 15, 2017, 12:34:26 pm

Title: NTPD process keeps exiting from time to time
Post by: muchacha_grande on December 15, 2017, 12:34:26 pm
Hi,
    I'm using OPNSense virtualized on a VMWare ESXi 6 server.
    Sinse I was using pf... and now that I've migrated to OPNSense I'm having an issue with NTPD service.
    The process keeps exiting from time to time, so I have to use monit to restart the service automatically.

This is the log at the time of the hang:
Dec 15 08:17:30    ntpd[81233]: mlockall(): Cannot allocate memory
Dec 15 08:17:30    ntpd[81233]: Listening on routing socket on fd #39 for interface updates
Dec 15 08:17:30    ntpd[81233]: Listen normally on 18 em0_vlan6 [2001:470:d:106:ff0a::1]:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 17 em0_vlan6 10.1.10.1:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 16 em0_vlan6 [fe80::20c:29ff:fe72:ee%14]:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 15 em0_vlan5 [2001:470:d:106:99::1]:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 14 em0_vlan5 192.168.99.1:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 13 em0_vlan5 [fe80::20c:29ff:fe72:ee%13]:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 12 em0_vlan3 [2001:470:d:106::1]:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 11 em0_vlan3 192.168.0.1:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 10 em0_vlan3 [fe80::20c:29ff:fe72:ee%11]:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 9 em0_vlan2 [2001:470:d:106:2::1]:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 8 em0_vlan2 192.168.2.1:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 7 em0_vlan2 [fe80::20c:29ff:fe72:ee%10]:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 6 lo0 127.0.0.1:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 5 lo0 [::1]:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 4 em0 [2001:470:d:106:1::1]:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 3 em0 192.168.1.1:123
Dec 15 08:17:30    ntpd[81233]: Listen normally on 2 em0 [fe80::20c:29ff:fe72:ee%1]:123
Dec 15 08:17:30    ntpd[81233]: Listen and drop on 1 v4wildcard 0.0.0.0:123
Dec 15 08:17:30    ntpd[81233]: Listen and drop on 0 v6wildcard [::]:123
Dec 15 08:17:30    ntpd[81233]: restrict: 'monitor' cannot be disabled while 'limited' is enabled
Dec 15 08:17:30    ntpd[81233]: proto: precision = 2.514 usec (-19)
Dec 15 08:17:30    ntpd[81053]: Command line: /usr/local/sbin/ntpd -g -c /var/etc/ntpd.conf -p /var/run/ntpd.pid
Dec 15 08:17:30    ntpd[81053]: ntpd 4.2.8p10@1.3728-o Wed Jul 26 06:44:42 UTC 2017 (1): Starting
Dec 15 08:17:30    ntp: Starting NTP Daemon.
Dec 15 08:17:30    ntp: Successfully synced time after 2 attempts.
Dec 15 08:17:30    ntpdate[2099]: adjust time server 129.250.35.251 offset 0.010204 sec
Dec 15 08:17:12    ntpd[76017]: 129.250.35.251 local addr 192.168.0.1 -> <null>
Dec 15 08:17:12    ntpd[76017]: ntpd exiting on signal 15 (Terminated)
Dec 15 08:17:07    ntpdate[82083]: the NTP socket is in use, exiting
Dec 15 08:17:05    ntpd[76017]: mlockall(): Cannot allocate memory
Dec 15 08:17:05    ntpd[76017]: Listening on routing socket on fd #39 for interface updates
Dec 15 08:17:05    ntpd[76017]: Listen normally on 18 em0_vlan6 [2001:470:d:106:ff0a::1]:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 17 em0_vlan6 10.1.10.1:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 16 em0_vlan6 [fe80::20c:29ff:fe72:ee%14]:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 15 em0_vlan5 [2001:470:d:106:99::1]:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 14 em0_vlan5 192.168.99.1:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 13 em0_vlan5 [fe80::20c:29ff:fe72:ee%13]:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 12 em0_vlan3 [2001:470:d:106::1]:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 11 em0_vlan3 192.168.0.1:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 10 em0_vlan3 [fe80::20c:29ff:fe72:ee%11]:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 9 em0_vlan2 [2001:470:d:106:2::1]:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 8 em0_vlan2 192.168.2.1:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 7 em0_vlan2 [fe80::20c:29ff:fe72:ee%10]:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 6 lo0 127.0.0.1:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 5 lo0 [::1]:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 4 em0 [2001:470:d:106:1::1]:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 3 em0 192.168.1.1:123
Dec 15 08:17:05    ntpd[76017]: Listen normally on 2 em0 [fe80::20c:29ff:fe72:ee%1]:123

   Of course, monit restarts the process and everything goes on, but I don't think that it's working fine.
   Usually the process stops once or twice a day. Some times even more.
   I noticed that when the server is busier (the VMWare is using more CPU), the process stops more often.

   Hope someone can give me a clue.

Cheers...
Title: Re: NTPD process keeps exiting from time to time
Post by: franco on December 15, 2017, 12:41:25 pm
Ntpd is restarted under several circumstances, some being active admin GUI reconfiguration usage, or when a listening interfaces changes its address (e.g. DHCP on WAN).

So the question is... are you sure these are not intentional?

Signal 15 is SIGTERM:

https://github.com/opnsense/core/blob/16be17f050399c00f3f89cc6b6c3197b8f77c592/src/etc/inc/plugins.inc.d/ntpd.inc#L167


Cheers,
Franco
Title: Re: NTPD process keeps exiting from time to time
Post by: muchacha_grande on December 15, 2017, 01:08:59 pm
the process stops without GUI configuration changes and without interfaces address changes, not listening on wan either.
The interfaces that ntpd is listening to are all configured with static IPs.
In fact, I just receive the mails from monit telling me that "Does not exists ntpd" and two minutes later the message "Exists ntpd", because monit has a two minutes checking interval.

I've found this https://github.com/opnsense/core/issues/1785

Are there other circumstances that drives ntpd to exit?

Cheers,
Francisco