author | Brian Utterback <brian.utterback@oracle.com> |
Mon, 28 Nov 2016 18:59:56 -0800 | |
branch | s11u3-sru |
changeset 7534 | 2aa7c5a61a30 |
parent 6564 | cf734c3c4e88 |
permissions | -rw-r--r-- |
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
1 |
#!/sbin/sh |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
2 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
3 |
# CDDL HEADER START |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
4 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
5 |
# The contents of this file are subject to the terms of the |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
6 |
# Common Development and Distribution License (the "License"). |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
7 |
# You may not use this file except in compliance with the License. |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
8 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
10 |
# or http://www.opensolaris.org/os/licensing. |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
11 |
# See the License for the specific language governing permissions |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
12 |
# and limitations under the License. |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
13 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
16 |
# If applicable, add the following below this CDDL HEADER, with the |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
19 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
20 |
# CDDL HEADER END |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
21 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
22 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
23 |
# |
7534
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
24 |
# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. |
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
25 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
26 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
27 |
# Standard prolog |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
28 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
29 |
. /lib/svc/share/smf_include.sh |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
30 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
31 |
if [ -z $SMF_FMRI ]; then |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
32 |
echo "SMF framework variables are not initialized." |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
33 |
exit $SMF_EXIT_ERR |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
34 |
fi |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
35 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
36 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
37 |
# Is NTP configured? |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
38 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
39 |
if [ ! -f /etc/inet/ntp.conf ]; then |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
40 |
echo "Error: Configuration file '/etc/inet/ntp.conf' not found." \ |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
41 |
" See ntpd(1M)." |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
42 |
exit $SMF_EXIT_ERR_CONFIG |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
43 |
fi |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
44 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
45 |
# Disable globbing to prevent privilege escalations by users authorized |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
46 |
# to set property values for the NTP service. |
7534
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
47 |
set -f |
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
48 |
|
7534
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
49 |
# Do we want to run without setting the clock? If not and we don't have |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
50 |
# the priv to set the clock, exit. If so, remove the priv and |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
51 |
# continue on. Set env variable to tell ntpd to ignore EPERM errors. |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
52 |
val=`svcprop -c -p config/disable_local_time_adjustment $SMF_FMRI` |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
53 |
if [ "$val" = "true" ]; then |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
54 |
export IGNORE_SYS_TIME_ERROR=1 |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
55 |
ppriv -s EIP-sys_time $$ |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
56 |
else |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
57 |
ppriv -q sys_time |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
58 |
if (($? > 0)); then |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
59 |
echo "Error: Insufficient privilege to adjust the system clock." \ |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
60 |
" Set the disable_local_time_adjustment property to run anyway." |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
61 |
exit $SMF_EXIT_ERR_CONFIG |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
62 |
fi |
2aa7c5a61a30
24660275 adj_systime: too chatty on NGZ
Brian Utterback <brian.utterback@oracle.com>
parents:
6564
diff
changeset
|
63 |
fi |
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
64 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
65 |
# Build the command line flags |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
66 |
# |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
67 |
shift $# |
6564
cf734c3c4e88
22553853 NTP startup method should use long command line arguments for clarity
Brian Utterback <brian.utterback@oracle.com>
parents:
5423
diff
changeset
|
68 |
set -- --pidfile /var/run/ntp.pid |
432
4eda6f0a3346
6902531 ntp start method checks for global zone which should not be a requirement
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
172
diff
changeset
|
69 |
# We allow a step larger than the panic value of 17 minutes only |
5016
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
70 |
# once when ntpd starts up. If always_allow_large_step is true, |
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
71 |
# then we allow this each time ntpd starts. Otherwise, we allow |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
72 |
# it only the very first time ntpd starts after a boot. We |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
73 |
# check that by making ntpd write its pid to a file in /var/run. |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
74 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
75 |
val=`svcprop -c -p config/always_allow_large_step $SMF_FMRI` |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
76 |
if [ "$val" = "true" ] || \ |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
77 |
[ ! -f /var/run/ntp.pid ]; then |
6564
cf734c3c4e88
22553853 NTP startup method should use long command line arguments for clarity
Brian Utterback <brian.utterback@oracle.com>
parents:
5423
diff
changeset
|
78 |
set -- "$@" --panicgate |
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
79 |
fi |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
80 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
81 |
# Auth was off by default in xntpd now the default is on. Better have a way |
432
4eda6f0a3346
6902531 ntp start method checks for global zone which should not be a requirement
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
172
diff
changeset
|
82 |
# to turn it off again. Also check for the obsolete "authentication" keyword. |
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
83 |
val=`svcprop -c -p config/no_auth_required $SMF_FMRI` |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
84 |
if [ ! "$val" = "true" ]; then |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
85 |
val=`/usr/bin/nawk '/^[ \t]*#/{next} |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
86 |
/^[ \t]*authentication[ \t]+no/ { |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
87 |
printf("true", $2) |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
88 |
next } ' /etc/inet/ntp.conf` |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
89 |
fi |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
90 |
[ "$val" = "true" ] && set -- "$@" --authnoreq |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
91 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
92 |
# Set up logging if requested. |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
93 |
logfile=`svcprop -c -p config/logfile $SMF_FMRI` |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
94 |
val=`svcprop -c -p config/verbose_logging $SMF_FMRI` |
6564
cf734c3c4e88
22553853 NTP startup method should use long command line arguments for clarity
Brian Utterback <brian.utterback@oracle.com>
parents:
5423
diff
changeset
|
95 |
[ "$val" = "true" ] && [ -n "$logfile" ] && set -- "$@" --logfile $logfile |
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
96 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
97 |
# Register with mDNS. |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
98 |
val=`svcprop -c -p config/mdnsregister $SMF_FMRI` |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
99 |
mdns=`svcprop -c -p general/enabled svc:/network/dns/multicast:default` |
6564
cf734c3c4e88
22553853 NTP startup method should use long command line arguments for clarity
Brian Utterback <brian.utterback@oracle.com>
parents:
5423
diff
changeset
|
100 |
[ "$val" = "true" ] && [ "$mdns" = "true" ] && set -- "$@" --mdns |
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
101 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
102 |
# We used to support the slewalways keyword, but that was a Sun thing |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
103 |
# and not in V4. Look for "slewalways yes" and set the new slew option. |
5016
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
104 |
slew_always=`svcprop -c -p config/slew_always $SMF_FMRI` |
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
105 |
if [ ! "$slew_always" = "true" ]; then |
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
106 |
slew_always=`/usr/bin/nawk '/^[ \t]*#/{next} |
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
107 |
/^[ \t]*slewalways[ \t]+yes/ { |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
108 |
printf("true", $2) |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
109 |
next } ' /etc/inet/ntp.conf` |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
110 |
fi |
5016
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
111 |
[ "$slew_always" = "true" ] && set -- "$@" --slew |
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
112 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
113 |
# Set up debugging. |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
114 |
deb=`svcprop -c -p config/debuglevel $SMF_FMRI` |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
115 |
|
5016
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
116 |
# If slew_always is set to true, then the large offset after a reboot |
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
117 |
# might take a very long time to correct the clock. Optionally allow |
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
118 |
# a step once after a reboot if slew_always is set when allow_step_at_boot |
5423
ddffdfd1aff8
22462992 problem in SERVICE/NTP
Brian Utterback <brian.utterback@oracle.com>
parents:
5016
diff
changeset
|
119 |
# is also set. |
5016
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
120 |
val=`svcprop -c -p config/allow_step_at_boot $SMF_FMRI` |
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
121 |
if [ "$val" = "true" ] && [ "$slew_always" = "true" ] && \ |
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
122 |
[ ! -f /var/run/ntp.pid ]; then |
6564
cf734c3c4e88
22553853 NTP startup method should use long command line arguments for clarity
Brian Utterback <brian.utterback@oracle.com>
parents:
5423
diff
changeset
|
123 |
set -- "$@" --force-step-once |
5016
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
124 |
fi |
e7921135918b
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
432
diff
changeset
|
125 |
|
172
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
126 |
# Start the daemon. If debugging is requested, put it in the background, |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
127 |
# since it won't do it on it's own. |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
128 |
if [ "$deb" -gt 0 ]; then |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
129 |
/usr/lib/inet/ntpd "$@" --set-debug-level=$deb >/var/ntp/ntp.debug & |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
130 |
else |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
131 |
/usr/lib/inet/ntpd "$@" |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
132 |
fi |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
133 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
134 |
# Now, wait for the first sync, if requested. |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
135 |
val=`svcprop -c -p config/wait_for_sync $SMF_FMRI` |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
136 |
[ "$val" = "true" ] && /usr/lib/inet/ntp-wait |
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
137 |
|
093198acf7d4
7018272 Move NTP to userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff
changeset
|
138 |
exit $SMF_EXIT_OK |