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 # default user if not overriden by config
18 # Source ntp configuration
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
24 msg_network_down "ntpd"
31 [ -f /etc/ntp/ntp.conf ] || exit 0
34 # Check if the service is already running?
35 if [ ! -f /var/lock/subsys/ntpd ]; then
37 daemon /usr/sbin/ntpd -c /etc/ntp/ntp.conf -p /var/run/ntpd.pid ${NTPD_USER:+-u $NTPD_USER} $NTPD_OPTIONS
39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntpd
41 msg_already_running "ntpd"
46 if [ -f /var/lock/subsys/ntpd ]; then
49 rm -f /var/lock/subsys/ntpd
51 msg_not_running "ntpd"
56 if [ -f /var/lock/subsys/ntpd ]; then
60 msg_not_running "ntpd"
66 # See how we were called.
78 # NB! don't remove 'condrestart': dhcpcd calls this
79 try-restart|condrestart)
90 msg_usage "$0 {start|stop|restart|try-restart|force-reload|condrestart|status}"