components/ntp/Solaris/ntp.sh
changeset 5361 7e2f2fc264b8
parent 4486 8a12763ec19a
child 5961 2b7cc56a6e80
equal deleted inserted replaced
5360:af56e129673d 5361:7e2f2fc264b8
    19 #
    19 #
    20 # CDDL HEADER END
    20 # CDDL HEADER END
    21 #
    21 #
    22 
    22 
    23 #
    23 #
    24 # Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
    24 # Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
    25 #
    25 #
    26 
    26 
    27 # Standard prolog
    27 # Standard prolog
    28 #
    28 #
    29 . /lib/svc/share/smf_include.sh
    29 . /lib/svc/share/smf_include.sh
    99 deb=`svcprop -c -p config/debuglevel $SMF_FMRI`
    99 deb=`svcprop -c -p config/debuglevel $SMF_FMRI`
   100 
   100 
   101 # If slew_always is set to true, then the large offset after a reboot
   101 # If slew_always is set to true, then the large offset after a reboot
   102 # might take a very long time to correct the clock. Optionally allow
   102 # might take a very long time to correct the clock. Optionally allow
   103 # a step once after a reboot if slew_always is set when allow_step_at_boot
   103 # a step once after a reboot if slew_always is set when allow_step_at_boot
   104 # is also set. Unfortunately ntpd in ntpdate mode is a little too 
   104 # is also set. 
   105 # chatty, so direct the log to /dev/null. And since the offset might be
       
   106 # more than 17 minutes, allow larger steps with the "-g".
       
   107 #
       
   108 val=`svcprop -c -p config/allow_step_at_boot $SMF_FMRI`
   105 val=`svcprop -c -p config/allow_step_at_boot $SMF_FMRI`
   109 if [ "$val" = "true" ] && [ "$slew_always" = "true" ] && \
   106 if [ "$val" = "true" ] && [ "$slew_always" = "true" ] && \
   110     [ ! -f /var/run/ntp.pid ]; then
   107     [ ! -f /var/run/ntp.pid ]; then
   111 	/usr/lib/inet/ntpd -q -l /dev/null -g
   108 	set -- "$@" -G
   112 fi
   109 fi
   113 
   110 
   114 # Start the daemon. If debugging is requested, put it in the background, 
   111 # Start the daemon. If debugging is requested, put it in the background, 
   115 # since it won't do it on it's own.
   112 # since it won't do it on it's own.
   116 if [ "$deb" -gt 0 ]; then
   113 if [ "$deb" -gt 0 ]; then