vesta cp was uninstalled a long time ago (it’s update server was hacked, after that it seems the vestacp developers did not want to invest in it anymore, very sad, was a great webserver and mail control panel)

ntp things have changed a bit in Debian 11 (search)

ntp is not installed per default anymore

hostnamectl; # tested on
Operating System: Debian GNU/Linux 10 (buster)
Kernel: Linux 4.19.0-18-amd64
Architecture: x86-64

# but also on Debian 11
su - root
apt update
apt install ntp
systemctl restart ntp
ntpq -p; # check diff

vim /etc/ntp.conf; # should look something like (here custom ntp servers can be specified)
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

# Leap seconds definition provided by tzdata
leapfile /usr/share/zoneinfo/leap-seconds.list

# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable


# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example

# pool.ntp.org maps to about 1000 low-stratum NTP servers.  Your server will
# pick a different set every time it starts up.  Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
pool 0.debian.pool.ntp.org iburst
pool 1.debian.pool.ntp.org iburst
pool 2.debian.pool.ntp.org iburst
pool 3.debian.pool.ntp.org iburst


# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details.  The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Needed for adding pool entries
restrict source notrap nomodify noquery

# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust


# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255

# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines.  Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient

vestacp error report:

test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
run-parts: /etc/cron.daily/ntpdate exited with return code 1

try and error2:

 

vim /etc/default/ntpdate; # open up ntpdate config file

# The settings in this file are used by the program ntpdate-debian, but not
# by the upstream program ntpdate.

# Set to "yes" to take the server list from /etc/ntp.conf, from package ntp,
# so you only have to keep it in one place.
NTPDATE_USE_NTP_CONF=yes

vim /etc/ntp.conf; # checkout ntp config file... 

# custom servers :-D let's try if it brings anything
server 0.de.pool.ntp.org
server 1.de.pool.ntp.org
server 2.de.pool.ntp.org
server 3.de.pool.ntp.org

# hetzner ntp servers 
server ntp1.hetzner.de iburst
server ntp2.hetzner.com iburst
server ntp3.hetzner.net iburst

try and error1:

vim /etc/cron.daily/ntpdate; # open ntpdate script that will sync your system's time with time-server daily

#!/bin/sh
/usr/sbin/ntpdate -s -q de.pool.ntp.org; # add the COUNTRYCODE.pool.ntp.org and -q and ntpdate should work fine even in sh shell

next problem: now i get mails like:

should i set $? = 0 manually? faking a positive result? NOPE! NEVER! STAY SINCERE!

/etc/cron.daily/ntpdate:
server 78.47.226.8, stratum 2, offset 0.006584, delay 0.04008
server 95.129.55.109, stratum 3, offset 0.001914, delay 0.03778
server 5.9.49.116, stratum 2, offset 0.001216, delay 0.02783
server 144.76.38.73, stratum 2, offset -0.005650, delay 0.03960

the investigation 😀

ntpdate -s 

-s Divert logging output from the standard output (default) to the system syslog facility. This is designed primarily for convenience of cron scripts.

-> so you will not see any error.

if you leave out -s you get:

ntpdate exit code 1  1 Jun 11:06:28 ntpdate[15283]: the NTP socket is in use, exiting

“ntpdate service having a problem doesn’t really mean there’s a problem with ntpd, ntpdate is a standalone utility,
(you don’t even need the ntp package installed to use ntpdate) you could try a query and then see if that works:”

/usr/sbin/ntpdate -q de.pool.ntp.org
server 46.165.194.70, stratum 2, offset -0.000925, delay 0.03108
server 5.9.67.110, stratum 3, offset -0.001917, delay 0.02618
server 178.23.121.165, stratum 2, offset -0.000919, delay 0.04784
server 62.116.162.126, stratum 2, offset 0.000324, delay 0.03813
 1 Jun 11:08:42 ntpdate[15333]: adjust time server 46.165.194.70 offset -0.000925 sec

links:

http://forums.fedoraforum.org/showthread.php?t=284140

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin