Time Sync Question - NTP & Chrony Not Working

How does the system clock stay in sync on my freepbx server, it seems to be keeping time sync’d, I just note:

FreePBX 14.0.3.7 / Asterisk 13.19.1

[root@pbx mike]# systemctl status chronyd
Unit chronyd.service could not be found.

[root@pbx mike]# cat /etc/chrony.conf
cat: /etc/chrony.conf: No such file or directory

[root@pbx mike]# systemctl status ntpd
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)

Is ntpdate run, or something else?

PS - this was an older system upgraded to SNG7 and I have fully updated all modules and RPMs.

I see this: https://issues.freepbx.org/browse/FREEPBX-16661

rm -Rf /etc/systemd/system/chronyd.service
yum reinstall sangoma-pbx

However, I do not have a file called: /etc/systemd/system/chronyd.service

I have a directory called /etc/systemd/system/chronyd.service.d

I am also leery to do this yum reinstall sangoma-pbx as this is a production system.

Any thoughts

Running reinstall won’t affect your production system. It doesn’t uninstall anything.

OK, so since I do not have the file entitled “/etc/systemd/system/chronyd.service”

I should just run: yum reinstall sangoma-pbx

Correct?

OK, I went ahead with the re-install, knock on wood no issues, after re-install I still do not see chrony running, is there something else I need to do?

[root@pbx system]# systemctl status chronyd
Unit chronyd.service could not be found.

here is the output of the re-install:

[root@pbx mike]# yum reinstall sangoma-pbx
Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile

Resolving Dependencies
–> Running transaction check
—> Package sangoma-pbx.noarch 0:1805-3.sng7 will be reinstalled
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size

Reinstalling:
sangoma-pbx noarch 1805-3.sng7 sng-pkgs 16 k

Transaction Summary

Reinstall 1 Package

Total download size: 16 k
Installed size: 15 k
Is this ok [y/d/N]: y
Downloading packages:
sangoma-pbx-1805-3.sng7.noarch.rpm | 16 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : sangoma-pbx-1805-3.sng7.noarch 1/1
Redirecting to /bin/systemctl restart httpd.service
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: No such file or directory
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file o r directory
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-arptables: No such file or directory
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.conf.all.arp_ignore = 1
kernel.panic = 20
Redirecting to /bin/systemctl stop vsftpd.service
Note: Forwarding request to ‘systemctl disable vsftpd.service’.
Redirecting to /bin/systemctl restart xinetd.service
Verifying : sangoma-pbx-1805-3.sng7.noarch 1/1

Installed:
sangoma-pbx.noarch 0:1805-3.sng7

Complete!

The chronyd.service file comes from chrony itself. I’m guessing it’s not installed? This could be something that I missed in the 6-7 upgrade

[root@sng7 LetsEncrypt]# yum provides */chronyd.service
Loaded plugins: auto-update-debuginfo, fastestmirror, kabi, versionlock
Loading support for Red Hat kernel ABI
Loading mirror speeds from cached hostfile
chrony-3.2-2.el7.x86_64 : An NTP client/server
Repo        : sng-base
Matched from:
Filename    : /usr/lib/systemd/system/chronyd.service



chrony-3.2-2.el7.x86_64 : An NTP client/server
Repo        : @sng-base/7.5
Matched from:
Filename    : /usr/lib/systemd/system/chronyd.service

I just installed chrony, yum -y install chrony

Is there some setup I need to do with it?

[root@pbx mike]# systemctl start chronyd
[root@pbx mike]# systemctl enable chronyd
[root@pbx mike]# chronyc sources

210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample

^- ntp.wdc1.us.leaseweb.net 2 6 33 1 +3265us[+3265us] +/- 238ms
^- ns3.weiszhosting.com 2 6 17 2 -852us[ -852us] +/- 59ms
^* clock.sjc.he.net 1 6 17 3 -12us[ -25us] +/- 9944us
^- 209-133-217-165.static.h> 2 6 17 3 -52us[ -340ms] +/- 45ms

Nope. That’s it. Looks like I forgot to add that to the upgrade! Thanks 8)

Thanks Rob for all your good work.

1 Like

Thank you for reporting bugs and helping us fix them! 8)

sangoma-pbx-1807-1 is being built and tested right now, which fixes that, so for anyone else that missed it as part of the upgrade, they’ll get it next time they do a ‘yum update’.

Edit: Done! Thanks again 8)

[root@sng7 sangoma-pbx]# yum update
Loaded plugins: auto-update-debuginfo, fastestmirror, kabi, versionlock
Loading support for Red Hat kernel ABI
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package sangoma-pbx.noarch 0:1805-3.sng7 will be updated
---> Package sangoma-pbx.noarch 0:1807-1.sng7 will be an update
--> Processing Dependency: chrony for package: sangoma-pbx-1807-1.sng7.noarch
--> Running transaction check
---> Package chrony.x86_64 0:3.2-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================
 Package                    Arch                  Version                      Repository               Size
=============================================================================================================
Updating:
 sangoma-pbx                noarch                1807-1.sng7                  sng-pkgs                 16 k
Installing for dependencies:
 chrony                     x86_64                3.2-2.el7                    sng-base                243 k

Transaction Summary
=============================================================================================================
Install             ( 1 Dependent package)
Upgrade  1 Package

Total download size: 259 k
Is this ok [y/d/N]:
1 Like

Just an fyi, after the manual install, this file still does not exist, so maybe somehting has changed with that:

/etc/systemd/system/chronyd.service

[root@pbx mike]# ls -al /etc/systemd/system/chronyd.service
ls: cannot access /etc/systemd/system/chronyd.service: No such file or directory

I do however see this directory:

/etc/systemd/system/chronyd.service.d

[root@pbx system]# ls -al /etc/systemd/system/chronyd.service.d
total 12
drwxr-xr-x 2 root root 4096 Jul 22 13:07 .
drwxr-xr-x 13 root root 4096 May 23 08:56 …
-rw-r–r-- 1 root root 86 Jun 7 09:14 sangoma_chrony_override.conf

That’s the actual service file, that systemd uses. I’m not sure where you got that other filename from, but the one in /usr/lib/systemd is where it should be. Things in /etc are system-specific configurations (according to the way systemd works).

Edit: Ooh, from the ticket? Yes. That is because that file was incorrect, and shouldn’t exist.

Got it, thanks.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.