Browse files

OS-600 don't try to sync separately first, just add -g to normal ntpd…

… so svcadm disable doesn't fail due to long method start.
  • Loading branch information...
1 parent 867b10d commit 422e8c1c7042f4865fd2a2733ea5da3f8a6fc33e @joshwilsdon joshwilsdon committed Sep 15, 2011
Showing with 11 additions and 14 deletions.
  1. +11 −14 ntp/Solaris/ntp
View
25 ntp/Solaris/ntp
@@ -33,6 +33,8 @@
smf_is_globalzone || exit $SMF_EXIT_OK
+NTPD_OPTIONS=
+
if [ -z $SMF_FMRI ]; then
echo "SMF framework variables are not initialized."
exit $SMF_EXIT_ERR
@@ -49,27 +51,22 @@ fi
# Disable globbing to prevent privilege escalations by users authorized
# to set property values for the NTP service.
-set -f
+set -f
#
# Build the command line flags
#
shift $#
set -- -p /var/run/ntp.pid
-# We allow a step large than the panic value of 17 minutes only
-# once when ntpd starts up. If always_all_large_step is true,
+# We allow a step large than the panic value of 17 minutes only
+# once when ntpd starts up. If always_all_large_step is true,
# then we allow this each time ntpd starts. Otherwise, we allow
-# it only the very first time ntpd starts after a boot. We
+# it only the very first time ntpd starts after a boot. We
# check that by making ntpd write its pid to a file in /var/run.
val=`svcprop -c -p config/always_allow_large_step $SMF_FMRI`
-if [ "$val" = "true" ] || \
- [ ! -f /var/run/ntp.pid ]; then
- set -- "$@" -g
-
- # Large step is ok, so on startup do a full update first
- # before we actually start.
- ntpd -gq
+if [ "$val" = "true" ]; then
+ NTPD_OPTIONS="${NTPD_OPTIONS} -g"
fi
# Auth was off by default in xntpd now the default is on. Better have a way
@@ -107,12 +104,12 @@ fi
# Set up debugging.
deb=`svcprop -c -p config/debuglevel $SMF_FMRI`
-# Start the daemon. If debugging is requested, put it in the background,
+# Start the daemon. If debugging is requested, put it in the background,
# since it won't do it on it's own.
if [ "$deb" -gt 0 ]; then
- /usr/sbin/ntpd "$@" --set-debug-level=$deb >/var/ntp/ntp.debug &
+ /usr/sbin/ntpd ${NTPD_OPTIONS} "$@" --set-debug-level=$deb >/var/ntp/ntp.debug &
else
- /usr/sbin/ntpd "$@"
+ /usr/sbin/ntpd ${NTPD_OPTIONS} "$@"
fi
# Now, wait for the first sync, if requested.

0 comments on commit 422e8c1

Please sign in to comment.