Skip to main content
Topic: [NEW SERVICE] ntpd-rs instead of openntpd (Read 127 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[NEW SERVICE] ntpd-rs instead of openntpd

Hello,

Today I installed and activated a new NTP client  (which can work also as a server, but it is outside of the scope of my current presentation) that implements the NTP and NTS protocols (see documentation); it is developed in Rust - hopefully it is fast, robust and secure.

I have disabled the default NTP client (openntpd) since it was failing to synchronize the clock.

The AUR package builds it from source, but we still need the dinit service description; well, here it is ...

There are two things we need to know related to this configuration:
  • I tried to make it run under the ntp account identity (which already exists) - it refuses to start
  • Since it requires the folder /run/ntpd-rs/ to be created, I had to add the pre script to handle the folder creation

If somebody has ideas about how to improve this service, your suggestions are welcome !

Here is the ntpd-rs service description file
Code: [Select]
# ntpd-rs 
type            = process
command         = /usr/bin/ntp-daemon --log-level=info
start-timeout   = 60
smooth-recovery = true
socket-listen   = /var/run/ntpd-rs/observe
# run-as          = ntp
log-type        = file
logfile         = /var/log/dinit/ntpd-rs.log
depends-on      = network.target
before          = time-sync.target
load-options    = export-service-name
depends-ms      = ntpd-rs-pre

And the ntpd-rs-pre script description file
Code: [Select]
type        = scripted
command     = mkdir -p /run/ntpd-rs/
depends-on  = local.target
before      = ntpd-rs