]> git.pld-linux.org Git - packages/ntp.git/commitdiff
- files to support indepeden installation of ntp server and client (just for sync)
authorMarcin Krzyżanowski <marcin.krzyzanowski@hakore.com>
Fri, 5 Mar 2004 11:47:32 +0000 (11:47 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    ntp-client.init -> 1.1
    ntp-client.sysconfig -> 1.1
    ntp.init -> 1.14
    ntp.sysconfig -> 1.4

ntp-client.init [new file with mode: 0644]
ntp-client.sysconfig [new file with mode: 0644]
ntp.init
ntp.sysconfig

diff --git a/ntp-client.init b/ntp-client.init
new file mode 100644 (file)
index 0000000..ae0d0b6
--- /dev/null
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# ntp          This shell script takes care of starting and stopping
+#              ntp (NTP client).
+#
+# chkconfig:   2345 55 10
+# description: ntp is the NTP client.
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Source ntp configuration
+. /etc/sysconfig/ntp
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               # nls "ERROR: Networking is down. %s can't be run." <service>
+               msg_network_down ntp
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+[ -x /usr/sbin/ntpdate ] || exit 0
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       if is_yes "$SYNC_TIME"; then
+               # Adjust time
+               run_cmd "Syncing time for ntp" "/usr/sbin/ntpdate $NTPDATE_OPTIONS $NTPDATE_SERVERS"
+               RETVAL=$?
+       fi
+       ;;
+  stop)
+       exit $RETVAL
+       ;;
+  restart|force-reload)
+       $0 start
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|restart|force-reload}"
+       exit 3
+esac
+
+exit $RETVAL
diff --git a/ntp-client.sysconfig b/ntp-client.sysconfig
new file mode 100644 (file)
index 0000000..d6d29c5
--- /dev/null
@@ -0,0 +1,4 @@
+# Sync time at startup
+SYNC_TIME=no
+NTPDATE_OPTIONS="-o 1"
+NTPDATE_SERVERS="ntp.nasa.gov clock.isc.org vega.cbk.poznan.pl"
index 3f683b5d576edda6ef1fb9e59a51f97484ad469f..e2ec46a8fd5549e4f3a1b53fa11b5f5f77a6198f 100644 (file)
--- a/ntp.init
+++ b/ntp.init
@@ -1,10 +1,10 @@
 #!/bin/sh
 #
-# ntp          This shell script takes care of starting and stopping
+# ntpd         This shell script takes care of starting and stopping
 #              ntp (NTP daemon).
 #
 # chkconfig:   2345 55 10
-# description: ntp is the NTP daemon.
+# description: ntpd is the NTP daemon.
 
 # Source function library.
 . /etc/rc.d/init.d/functions
 . /etc/sysconfig/network
 
 # Source ntp configuration
-. /etc/sysconfig/ntp
+. /etc/sysconfig/ntpd
 
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
        if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
                # nls "ERROR: Networking is down. %s can't be run." <service>
-               msg_network_down ntp
+               msg_network_down ntpd
                exit 1
        fi
 else
@@ -33,26 +33,22 @@ RETVAL=0
 case "$1" in
   start)
        # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/ntp ]; then
-               if is_yes "$SYNC_TIME"; then
-                       # Adjust time to make life easy for ntp
-                       run_cmd "Syncing time for ntp" "/usr/sbin/ntpdate $NTPDATE_OPTIONS $NTPDATE_SERVERS"
-               fi
-               msg_starting ntp
+       if [ ! -f /var/lock/subsys/ntpd ]; then
+               msg_starting ntpd
                daemon ntpd -c /etc/ntp/ntp.conf
                RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntp
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntpd
        else
                msg_already_running ntp
        fi
        ;;
   stop)
-       if [ -f /var/lock/subsys/ntp ]; then
-               msg_stopping ntp
+       if [ -f /var/lock/subsys/ntpd ]; then
+               msg_stopping ntpd
                killproc ntpd
-               rm -f /var/lock/subsys/ntp
+               rm -f /var/lock/subsys/ntpd
        else
-               msg_not_running ntp
+               msg_not_running ntpd
        fi
        ;;
   status)
index 440a6afb0db78ee3640635821cfe07575b22be97..fb8d89a3d31a8067ca2efec413b5937ae272b325 100644 (file)
@@ -2,8 +2,3 @@
 
 # Define services nice level
 SERVICE_RUN_NICE_LEVEL="+1"
-
-# Sync time at startup
-SYNC_TIME=no
-NTPDATE_OPTIONS="-o 1"
-NTPDATE_SERVERS="ntp.nasa.gov clock.isc.org vega.cbk.poznan.pl"
This page took 0.066844 seconds and 4 git commands to generate.