• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

/var/log/chrony Directory Empty in CentOS/RHEL

by admin

This post explains why the /var/log/chrony folder empty though the chronyd service is configured and running.

# ls -l /var/log/chrony/

Chronyd status shows running:

# systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-03-25 17:00:20 IST; 3min 30s ago
Docs: man:chronyd(8)
man:chrony.conf(5)
Process: 12987 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
Process: 12983 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 12985 (chronyd)
CGroup: /system.slice/chronyd.service
└─12985 /usr/sbin/chronyd

Mar 25 17:00:20 [hostname] systemd[1]: Starting NTP client/server...
Mar 25 17:00:20 [hostname] chronyd[12985]: chronyd version 3.4 startin...)
Mar 25 17:00:20 [hostname] chronyd[12985]: Frequency -12.453 +/- 0.047...t
Mar 25 17:00:20 [hostname] systemd[1]: Started NTP client/server.
Mar 25 17:00:24 [hostname] chronyd[12985]: Selected source 
Hint: Some lines were ellipsized, use -l to show in full.

In the chrony.conf file logdir also enabled/configured:

# cat /etc/chrony.conf |grep log
# Specify directory for log files.
logdir /var/log/chrony
# Select which information is logged.
#log measurements statistics tracking

Enabling Chrony statistics logs

1. The Directory /var/log/chrony used to store statistics logs, by default the “log measurements” parameter is commented(disabled), to enable the statistics logs.

2. Edit the /etc/chrony.conf file and uncomment the line starts with “log measurements”. For example:

From:

# Select which information is logged.
#log measurements statistics tracking

To:

# Select which information is logged.
log measurements statistics tracking

3. Restart the chronyd service:

# systemctl restart chronyd

4. Now list the Directory and verify:

# ls -l /var/log/chrony/
total 12
-rw-r--r--. 1 chrony chrony 959 Mar 25 17:04 measurements.log
-rw-r--r--. 1 chrony chrony 585 Mar 25 17:04 statistics.log
-rw-r--r--. 1 chrony chrony 792 Mar 25 17:04 tracking.log

Filed Under: CentOS/RHEL, Linux

Some more articles you might also be interested in …

  1. pgrep Command Examples in Linux
  2. ufw: command not found
  3. Interview Questions : Linux Package Manager (RPM)
  4. xz: command not found
  5. LVM Commands Fail With “Failed to load config file /etc/lvm/lvm.conf”
  6. Understanding rsyslog Filter Options
  7. lvs: command not found
  8. How to uninstall neovim from Ubuntu
  9. btrfs restore Command Examples in Linux
  10. chfn: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright