• 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

How to Automatically Run ntpdate When Starting NTPD in CentOS/RHEL 5

by admin

Question: How to Automatically Run ntpdate When Starting NTPD in CentOS/RHEL 5?

1. By default the file /etc/ntp/step-tickers is empty, to sync the time with ntpdate during the start of ntpd, we need to enter the ip addresses of your time server:

# cat /etc/ntp.conf | grep server
server 192.168.X.1
server 192.168.Y.2
# cat /etc/ntp/step-tickers
192.168.X.1
192.168.Y.2

2. Now we can restart the ntp server.

# /etc/init.d/ntpd restart
Shutting down ntpd:                        [ OK ]
ntpd: Synchronizing with timer server:     [ OK ]
Starting ntpd:                             [ OK ]

ntpd: Synchronizing with timer server: [ OK ], indicates that ntpdate was run during the start of ntpd.

3. When the -x option in /etc/sysconfig/ntpd is used, ntpd will automatically use the time servers configured in /etc/ntp.conf to sync the time when starting even when /etc/ntp/step-tickers is empty.

Filed Under: CentOS/RHEL, CentOS/RHEL 5, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : Exclusion with Yum For Kernel Updates
  2. How to Create a New /boot Partition in CentOS / RHEL
  3. How to troubleshoot iSCSI issues in CentOS / RHEL 6,7
  4. How to Set “dev_loss_tmo” Value Persistently Using Udev Rule
  5. Sample /etc/kdump.conf configuration file
  6. “VDO Status: Out of space” – Error while creating a VDO disk
  7. Understanding SELinux File Labelling and SELinux Context
  8. Ubuntu Linux – OpenShot Video Editor
  9. Starting udev: udevd inotify_init failed: too many open files
  10. Failed to Download Metadata for Repo ‘repo_name’

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright