Mar
31
2009

How to Set/Check the Arguments Used with “ntpd” Service

On RHEL, OEL, CentOS and various other Linux distribution the Network Time Protocol (NTP) daemon can be run with various options. As the daemon is usually defined as a service where managed by:

  • /etc/init.d/ntpd <…>
  • service ntpd <…>

commands, it is better to use the configuration file

/etc/sysconfig/ntpd

to set the arguments. The file looks like:

# Drop root to id ‘ntp:ntp’ by default.
OPTIONS=”-x -u ntp:ntp -p /var/run/ntpd.pid”

# Set to ‘yes’ to sync hw clock after successful ntpdate
SYNC_HWCLOCK=no

# Additional options for ntpdate
NTPDATE_OPTIONS=””

Above you can see that the command line arguments are setup by the OPTIONS configuration variable.

You can check the settings from that /etc/sysconfig/ntpd file but it will not be reliable if the ntpd process is started manually for some reason. To check the arguments you can use command line:

ps -o args -p `cat /var/run/ntpd.pid`

and the output will look like:

# ps -o args -p `cat /var/run/ntpd.pid`
COMMAND
ntpd -x -u ntp:ntp -p /var/run/ntpd.pid
#

Share
Written by in: linux | Tweet This

No Comments »

RSS feed for comments on this post. TrackBack URL


Leave a Reply

Powered by WordPress | Theme: Aeros 2.0 by TheBuckmaker.com