3 # ntp This shell script synchronizes time with ntpdate (NTP client)
5 # chkconfig: 2345 55 10
6 # description: ntp is the NTP client.
8 # Source function library.
9 . /etc/rc.d/init.d/functions
11 # Source networking configuration.
12 . /etc/sysconfig/network
14 # Source ntp configuration
17 # Check that networking is up.
18 if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
28 show "Syncing time with ntpdate (backgrounding)"
29 daemon --fork /usr/sbin/ntpdate -s $NTPDATE_OPTIONS $NTPDATE_SERVERS
31 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntp
35 rm -f /var/lock/subsys/ntp
39 # See how we were called.
52 is_yes "$NTPDATE_CRON" && /usr/sbin/ntpdate -s $NTPDATE_OPTIONS $NTPDATE_SERVERS > /dev/null 2>&1
56 msg_usage "$0 {start|restart|force-reload}"