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 # default user if not overriden by config
20 # Source ntp configuration
23 # Check that networking is up.
24 if is_yes "${NETWORKING}"; then
25 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
26 msg_network_down "ntpd"
33 [ -f /etc/ntp/ntp.conf ] || exit 0
36 # Check if the service is already running?
37 if [ ! -f /var/lock/subsys/ntpd ]; then
39 daemon /usr/sbin/ntpd -c /etc/ntp/ntp.conf -p /var/run/ntpd.pid ${NTPD_USER:+-u $NTPD_USER} $NTPD_OPTIONS
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntpd
43 msg_already_running "ntpd"
48 if [ -f /var/lock/subsys/ntpd ]; then
51 rm -f /var/lock/subsys/ntpd
53 msg_not_running "ntpd"
58 if [ -f /var/lock/subsys/ntpd ]; then
62 msg_not_running "ntpd"
68 # See how we were called.
80 # NB! don't remove 'condrestart': dhcpcd calls this
81 try-restart|condrestart)
92 msg_usage "$0 {start|stop|restart|try-restart|force-reload|condrestart|status}"