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
12 # Source networking configuration.
13 . /etc/sysconfig/network
15 # Source ntp configuration
18 # Check that networking is up.
19 if is_yes "${NETWORKING}"; then
20 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
28 [ -f /etc/ntp/ntp.conf ] || exit 0
31 # Check if the service is already running?
32 if [ ! -f /var/lock/subsys/ntpd ]; then
34 daemon ntpd -c /etc/ntp/ntp.conf -p /var/run/ntpd.pid $NTPD_OPTIONS
36 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntpd
38 msg_already_running ntp
43 if [ -f /var/lock/subsys/ntpd ]; then
46 rm -f /var/lock/subsys/ntpd
53 # See how we were called.
70 # NB! don't remove: dhcpcd calls this
71 if [ -f /var/lock/subsys/ntpd ]; then
77 msg_usage "$0 {start|stop|restart|force-reload|condrestart|status}"