Skip to main content

Operating System

Subtopics

How to check if the system is synchronized?

On RHEL7 the time synchronization is done via ntp and on RHEL9 via chrony. For license checkout either the license server(s) and the clients need to be synchronized timely.

Please check with 

timedatectl

if the system is synchronized.

13.webp13.webp
timedatectl output

In the screenshot above the system is not configured for time synchronization and ntp is disabled.

How to configure RHEL7 with ntp?

Note: In general customer IT is responsible to set up the time synchronization. The information below is just for your convenience, but is not part of GLPT support.

Prerequisite: 

You need a reliable time server. 

Steps to be checked:

  1. Check if ntp is installed with
    rpm -q ntp

    If it is not installed, you can try to get it with
    sudo yum install ntp

  2. open /etc/ntp.conf with an editor (you need editing permissions or sudo rights)
    Here you can add the NTP server with adding the line
    server hostname iburst
    Example:
    server time.google.com iburst

  3. Check if ntp service is enabled / started with
    systemctl status ntpd

    If it is not started / enabled

    1. Enable ntp service for being started with a reboot:
      sudo systemctl enable ntpd

    2. Start ntp service with
      sudo systemctl start ntpd

  4. Check the time synchronization: 
    sudo ntpq -p
    The ntpq command queries the ntp servers defined and you get with option -p a table back with statistics.

  5. Check with timedatectl, if ntp is enabled and synchronized.
    If ntp is still not enabled, use:

    sudo timedatectl set-ntp true
    sudo systemctl start ntpd
    Wait a minute and check with timedatectl again.

Addition from user experience

From user experience: even with configuring, enabling and starting the ntp daemon the synchronization status was still no (because the time servers configured had an offset). Using

sudo systemctl stop ntpd

sudo ntpd -gq

sudo systemctl start ntpd

helped here. The options are for (see also https://www.tekopolis.com/sync-ntp-immediately-linux/)

  1. option -q: overrides the built in sanity check of 1000s. If the system time is over 1000s off from the configured server time, the ntpd process would quit otherwise.

  2. option -q: for quitting the daemon after the clock has been set

How to configure RHEL9 with chrony?

Note: In general customer IT is responsible to set up the time synchronization. The information below is just for your convenience, but is not part of GLPT support.

Prerequisite: 

You need a reliable time server. 

Steps to be checked:

  1. Check if chrony is installed with
    rpm -q chrony

    If it is not installed, you can try to install it with
    sudo yum install chrony

  2. open /etc/chrony.conf with an editor (you need editing permissions or sudo rights)
    Here you can add the time server with adding the line
    server hostname iburst

    Example:
    server time.google.com iburst

  3. Check if chrony service is enabled / started with
    systemctl status chronyd

    If it is not started / enabled

    1. Enable chrony service for being started with a reboot:
      sudo systemctl enable chronyd

    2. Start chronyd service with
      sudo systemctl start chronyd

  4. Check with timedatectl, if chrony is enabled and synchronized.