Shadow_Saunter
Posts: 73
Joined: Thu Mar 22, 2018 2:04 pm

configuring ntp

Thu Apr 09, 2020 6:57 pm

I inherited a network of raspberry pi's that are fire-walled off from the open web. The server is also serving time synch via NTP. I need to duplicate this setup on a new network running Buster.

I've learned from this thread viewtopic.php?t=192020 that I need to install ntp and disable systemd-timesync for Buster, if I want it to work exactly like the previous server. I've done all of that and I have ntp.conf setup the way that I want it

I also did a systemctl stop and systemctl disable for systemd-timesyncd, and I restarted ntp after editing the ntp.conf.

The guide that I"m loosely following said to run the following in order to start ntp at boot, but I'm not sure what it does:

Code: Select all

# systemctl enable ntp
ntp.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ntp
Can someone explain this command?

User avatar
Rukbat
Posts: 25
Joined: Fri Nov 11, 2011 3:59 pm

Re: configuring ntp

Thu Apr 09, 2020 7:23 pm

You need to install ntpd. 'ntp' is a ptotocol, used to sync time. ntpd is the daemon running in the computer hat syncs the computer's time to an NTP server (somewhere out there in the world - there are a few).

Assuming that you installed the right thing, the line would be

Code: Select all

systemctl enable ntpd

Shadow_Saunter
Posts: 73
Joined: Thu Mar 22, 2018 2:04 pm

Re: configuring ntp

Thu Apr 09, 2020 7:33 pm

Didn't it install automatically? I'm asking because when I run systemctl status ntp I get:

Code: Select all

● ntp.service - Network Time Service
   Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-04-09 13:17:15 CDT; 11min ago
     Docs: man:ntpd(8)
  Process: 449 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status=0/SUCCESS)
 Main PID: 459 (ntpd)
    Tasks: 2 (limit: 2200)
   Memory: 2.1M
   CGroup: /system.slice/ntp.service
           └─459 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 109:114

Apr 09 13:26:00 RaspPi01 ntpd[459]: Soliciting pool server 162.159.200.1
<And a bunch of other servers>
Notice the Main PID: 459 is labelled NTPD

beta-tester
Posts: 1372
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: configuring ntp

Thu Apr 09, 2020 9:06 pm

Shadow_Saunter wrote:
Thu Apr 09, 2020 7:33 pm
Didn't it install automatically? I'm asking because when I run systemctl status ntp I get...
did you upgraded an old stretch to buster? then you have ntpd installed by default.
if you installed buster from a virgine image, then there is no ntpd installed by default.
at least not in the 2020-02-13-raspbian-buster.zip image. maybe it is in the full version.

if you are interested in time server, maybe that would be interesting to you:
https://github.com/beta-tester/RPi-GPS-PPS-StratumOne
but there i use chrony instead of ntpd as time-server-service

PS.: disabling systemd-timesyncd is not really necessary, because that service will test if ntpd or chrony or openntp services are installed.
and if, then it will not starting systemd-timesyncd.
see

Code: Select all

cat /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

Shadow_Saunter
Posts: 73
Joined: Thu Mar 22, 2018 2:04 pm

Re: configuring ntp

Fri Apr 10, 2020 2:37 pm

This is a virgin install. I'm actually trying to duplicate this raspberry network that was originally written on Jessie on a current version of Buster.
I'm pretty sure ntpd is running because it has a PID.

On another note, since I disabled 'timesynch' my pi seems to keep forgetting its wifi country code. I set it in raspi-config, and see that it is pretty explicitly defined in wpa_supplicant.conf. But with every reboot it forgets where it is and rf-kill suppresses wifi connection. I know that there is lower lever stuff happening after the boot sequence reads the supplicant, but I don't understand what. I see that there was a wave of this happening when the 3B+ was released a few years ago, but it isn't clear what the solution was.

I'm going to turn timesynch back on, and if that doesn't fix the issue then I'm going to start a new thread!

beta-tester
Posts: 1372
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: configuring ntp

Fri Apr 10, 2020 5:22 pm

  • which raspbian version do you use?
    2020-02-13-raspbian-buster-lite
    2020-02-13-raspbian-buster <- there is for shure no ntp installed by default.
    2020-02-13-raspbian-buster-full
  • what do you get, when you type in:

    Code: Select all

    dpkg --get-selections | grep ntp
  • the network settings in Jessie are very different from Buster.
    i guess, you can not use that much from the old Jessie settings.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

Shadow_Saunter
Posts: 73
Joined: Thu Mar 22, 2018 2:04 pm

Re: configuring ntp

Fri Apr 10, 2020 9:33 pm

beta-tester wrote:
Fri Apr 10, 2020 5:22 pm
  • which raspbian version do you use?
    2020-02-13-raspbian-buster-lite
    2020-02-13-raspbian-buster <- there is for shure no ntp installed by default.
    2020-02-13-raspbian-buster-full
  • what do you get, when you type in:

    Code: Select all

    dpkg --get-selections | grep ntp
  • the network settings in Jessie are very different from Buster.
    i guess, you can not use that much from the old Jessie settings.
You misunderstand, or I mispoke...

I installed ntp. Ntpd installed with it.

I don't think I care if systemd-timesyncd is running, I just want to provide time service for my fire-walled rpi network from a specific source which will work behind my proxy. It is named in my npd.conf (and my timesyncd.conf), is there any problem with that setup?

I can't test this until quarantine is over and I can get back into my proxy'd environment

Edit:

Based on the output of 'systemctl stop systemd-timesyncd', it looks like systemd-timesyncd failed to start because ntpd was running:

Code: Select all

● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: inactive (dead)
Condition: start condition failed at Fri 2020-04-10 16:14:36 CDT; 33min ago
           └─ ConditionFileIsExecutable=!/usr/sbin/ntpd was not met
     Docs: man:systemd-timesyncd.service(8)

Apr 10 16:14:36 USMadRpi01 systemd[1]: Condition check resulted in Network Time Synchronization being skipped.

I'm just going to disable it based to better match the config of the old network

beta-tester
Posts: 1372
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: configuring ntp

Sat Apr 11, 2020 6:00 am

You misunderstand...
yes, i guess i totally misunderstood you then.

Code: Select all

● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: inactive (dead)
Condition: start condition failed at Fri 2020-04-10 16:14:36 CDT; 33min ago
           └─ ConditionFileIsExecutable=!/usr/sbin/ntpd was not met
     Docs: man:systemd-timesyncd.service(8)
"ConditionFileIsExecutable=!/usr/sbin/ntpd was not met" means, that systemd-timesyncd.service is not starting, becaus of ntpd is intalled - so that is normal and intended.
(if systemd-timesyncd.service and ntpd.service would running at the same time, they would fight against each others to driscipline the system clock. ntpd tries to smoothout clock inperfections but systemd-timesyncd would kick in extra noise from time to time. that would result in a not always as percise system clock as it could running ntpd allone)
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

Return to “Troubleshooting”