1
January
2026
How to set up time synchronization in antiX Runit: Creating the ntpd service in Runit
23:56

How to set up time synchronization in antiX Runit: Creating the ntpd service in Runit

1 January 2026 23:56

The antiX distribution with the Runit service init system doesn't synchronize time over the internet out of the box. This article provides a solution for configuring and starting the ntpd service in runit for time synchronization.

Introduction

The runit system is non-standard for Linux. It is lighter than systemd.

Unlike SystemD, Runit doesn't have the ntpd service or the timedatectl command (see the article on time synchronization in systemd). On the other hand, managing services in runit is simpler—not with complex Units, but with "run" configuration files and the "sv" supervisor command.

Solution

1) Install the ntp utility, which will become the ntpd service at the end of this article.

sudo apt update
sudo apt install ntp

2) Create a folder for the service settings. AntiX uses the /etc/sv folder.

cd /etc/sv
sudo mkdir ntpd

3) Create a run command file.

cd /etc/sv/ntpd
sudo nano run

Add the following text to the file for starting the "run" service:

#!/bin/sh
# /etc/sv/ntpd/run
exec /usr/sbin/ntpd -d -p /run/ntpd.pid -c /etc/ntp.conf

where -c /etc/ntp.conf is the name of the configuration file.

3) Grant execute permissions (+x):

sudo chmod +x run

4) Create a symbolic link in services:

sudo ln -s /etc/sv/ntpd /etc/service/

5) Create a folder for the ntpsec component logs:

cd /var/log
sudo mkdir runit
cd runit
sudo mkdir ntpsec

6) Edit the /etc/ntp.conf file (empty by default).

sudo nano /etc/ntp.conf

My NTP client configuration file is as follows:

# General Configuration
pool 0.europe.pool.ntp.org iburst
pool 1.europe.pool.ntp.org iburst
pool 2.europe.pool.ntp.org iburst

# Local Clock (Fallback)
server 127.127.1.0
fudge 127.127.1.0 stratum 10

# File Locations
driftfile /var/lib/ntp/ntp.drift
# Log file for monitoring [8].
logfile /var/log/ntp.log

# --- Access Control ---
# Deny all access by default, but allow localhost (127.0.0.1, ::1) [5, 8].
restrict default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1

And saved it. Ctrl+S, Ctrl+X.

7) Select your time zone

sudo dpkg-reconfigure tzdata

The above command created a symbolic link. Checking with the command:

ls -l /etc/localtime

Result: "/etc/localtime -> /usr/share/zoneinfo/Europe/Moscow"

8) Start the ntpd service using the sv supervisor command:

sudo sv start ntpd

ok: run: ntpd: (pid 32041) 53s

9) Verify that the ntpd service is set to launch automatically (at startup):

"Start" - "Control Center" - "System" - "Choose Startup Services"

autorun-en.png

10) To ensure the updated time is displayed correctly, you must either reboot the PC or log out and log back in.

sudo reboot

Result

The antiX clock now displays local time (in this case, Moscow time) rather than UTC.