DEV Community

Fomalhaut Weisszwerg
Fomalhaut Weisszwerg

Posted on • Edited on

How to disable systemd-timesyncd (NTP service via systemd).

TL;DR

  1. Stop systemd-timesyncd

    sudo systemctl stop systemd-timesyncd
    
  2. Disable systemd-timesyncd

    sudo systemctl disable systemd-timesyncd
    

Done!

Introduction.

Today, so many things depend on accurate time-keeping. Thus we don't need to disable time sync usually, but sometimes -- workaround to annoying GPSD bugs and so on -- we need to disable it.

In the past, it was common to use ntpd for time sync. Since systemd-216, the systemd-timesyncd is often used.

This article provides you "how to check systemd-timesyncd is being used", "how to disable systemd-timesyncd" and "how to re-enable systemd-timesyncd".

How to check systemd-timesyncd is being used.

Run following command in a terminal.

systemctl status systemd-timesyncd
Enter fullscreen mode Exit fullscreen mode

If systemd-timesyncd is being used for time synchronization, you can see "Active: active (running)" in the result like following screenshot.

Result when systemd-timesyncd is active and running

On the other hand, systemd-timesyncd is not used, you can see "Active: inactive (dead)" in the result like following screenshot.

Result when systemd-timesyncd is inactive and not running

How to disable systemd-timesyncd.

At the first, you need to stop the service. To do this, run following command in a terminal.

sudo systemctl stop systemd-timesyncd
Enter fullscreen mode Exit fullscreen mode

Then disable systemd-timesyncd, run following command in a terminal.

sudo systemctl disable systemd-timesyncd
Enter fullscreen mode Exit fullscreen mode

disable systemd-timesyncd

How to re-enable systemd-timesyncd.

First, set 'enable' for systemd-timesyncd. To do this, run:

sudo systemctl enable systemd-timesyncd
Enter fullscreen mode Exit fullscreen mode

Then start the service of systemd-timesyncd. To do this, run:

sudo systemctl start systemd-timesyncd
Enter fullscreen mode Exit fullscreen mode

Finally, let's see systemd-timesyncd is really enabled. Run:

systemctl status systemd-timesyncd
Enter fullscreen mode Exit fullscreen mode

re-enable systemd-timesyncd

done!

Top comments (0)