OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: pyrodex on January 27, 2022, 09:20:21 pm

Title: ntpd pid file gone in 22.1?
Post by: pyrodex on January 27, 2022, 09:20:21 pm
So I had MONIT configured to monitor NTP via the pid file that in 21.X was under /var/run/ntpd.pid and with the upgrade to 22.1 it is gone.

Code: [Select]
root@firewall:/var/run # ps auxww | grep ntp
nobody   41571   0.0  0.1  750856  23484  -  S    14:29     0:00.57 /usr/local/bin/node_exporter --web.listen-address=192.168.14.1:9100 --collector.textfile.directory=/var/tmp/node_exporter --collector.ntp --collector.devstat
root     87267   0.0  0.0   21768   6936  -  Ss   15:17     0:00.02 /usr/local/sbin/ntpd -g -c /var/etc/ntpd.conf
root     74685   0.0  0.0   12740   2348  0  S+   15:19     0:00.00 grep ntp
root@firewall:/var/run # ls -la /var/run/ntp*
ls: No match.
root@firewall:/var/run #

So where is the ntpd file now?
Title: Re: ntpd pid file gone in 22.1?
Post by: Patrick M. Hausen on January 27, 2022, 09:29:33 pm
The feature was removed as stated in the release notes.
Quote
network time: remove PID file use as it can be unreliable

https://opnsense.org/opnsense-22-1-released/
Title: Re: ntpd pid file gone in 22.1?
Post by: franco on January 28, 2022, 09:37:36 am
After all the discussion of "pid file doesn't work for me" do we really want that pid file to be back to potentially show a wrong value?


Cheers,
Franco
Title: Re: ntpd pid file gone in 22.1?
Post by: h1d3m3 on February 05, 2022, 10:13:27 pm
This broke monit for me too. Monitoring was looking for that file (using PID File) and since it was gone, it would constantly restart ntp thinking it was dead.

Can anyone recommend an alternate means for monit to monitor that ntp is running? (maybe through ntpq -p or something like ntpstat?)

Cheers
Title: Re: ntpd pid file gone in 22.1?
Post by: tokade on February 06, 2022, 10:44:27 am
No please don't bring the PID file back - caused to much trouble ntpd not starting after reboot.

For monit you can change from PID to process match - just enter ntpd into the match field in the service definition.

Kind regards
Torsten
Title: Re: ntpd pid file gone in 22.1?
Post by: h1d3m3 on February 06, 2022, 03:51:09 pm
Thank you, that worked.

I didn't know "matched" was an option. When you use the PID field for a service, the match field option gets hidden. You have to delete the service setting first (starting clean) to show the field again. The result is:

Code: [Select]
check process ntpd  matching ntpd
   start program = "/usr/local/sbin/pluginctl -s ntpd start"
   stop program = "/usr/local/sbin/pluginctl -s ntpd stop"
   if failed host 127.0.0.1 port 123 type udp then alert