DEV Community

Fomalhaut Weisszwerg
Fomalhaut Weisszwerg

Posted on • Edited on

3 2

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!

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay