3 # ntpd This shell script takes care of starting and stopping
6 # chkconfig: 2345 55 10
7 # description: ntpd is the NTP daemon.
9 # Source function library.
10 . /etc/rc.d/init.d/functions
14 # Source networking configuration.
15 . /etc/sysconfig/network
17 # Source ntp configuration
20 # Check that networking is up.
21 if is_yes "${NETWORKING}"; then
22 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23 msg_network_down "ntpd"
30 [ -f /etc/ntp/ntp.conf ] || exit 0
33 # Check if the service is already running?
34 if [ ! -f /var/lock/subsys/ntpd ]; then
36 daemon /usr/sbin/ntpd -c /etc/ntp/ntp.conf -p /var/run/ntpd.pid -u ntp:ntp $NTPD_OPTIONS
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntpd
40 msg_already_running "ntpd"
45 if [ -f /var/lock/subsys/ntpd ]; then
48 rm -f /var/lock/subsys/ntpd
50 msg_not_running "ntpd"
55 if [ -f /var/lock/subsys/ntpd ]; then
59 msg_not_running "ntpd"
65 # See how we were called.
77 # NB! don't remove 'condrestart': dhcpcd calls this
78 try-restart|condrestart)
89 msg_usage "$0 {start|stop|restart|try-restart|force-reload|condrestart|status}"