components/ntp/Solaris/ntp.sh
changeset 432 4eda6f0a3346
parent 172 093198acf7d4
child 4486 8a12763ec19a
equal deleted inserted replaced
431:e60e527b8179 432:4eda6f0a3346
    26 
    26 
    27 # Standard prolog
    27 # Standard prolog
    28 #
    28 #
    29 . /lib/svc/share/smf_include.sh
    29 . /lib/svc/share/smf_include.sh
    30 
    30 
    31 smf_is_globalzone || exit $SMF_EXIT_OK
       
    32 
       
    33 if [ -z $SMF_FMRI ]; then
    31 if [ -z $SMF_FMRI ]; then
    34         echo "SMF framework variables are not initialized."
    32         echo "SMF framework variables are not initialized."
    35         exit $SMF_EXIT_ERR
    33         exit $SMF_EXIT_ERR
    36 fi
    34 fi
    37 
    35 
    51 #
    49 #
    52 # Build the command line flags
    50 # Build the command line flags
    53 #
    51 #
    54 shift $#
    52 shift $#
    55 set -- -p /var/run/ntp.pid
    53 set -- -p /var/run/ntp.pid
    56 # We allow a step large than the panic value of 17 minutes only 
    54 # We allow a step larger than the panic value of 17 minutes only 
    57 # once when ntpd starts up. If always_all_large_step is true, 
    55 # once when ntpd starts up. If always_all_large_step is true, 
    58 # then we allow this each time ntpd starts. Otherwise, we allow
    56 # then we allow this each time ntpd starts. Otherwise, we allow
    59 # it only the very first time ntpd starts after a boot. We 
    57 # it only the very first time ntpd starts after a boot. We 
    60 # check that by making ntpd write its pid to a file in /var/run.
    58 # check that by making ntpd write its pid to a file in /var/run.
    61 
    59 
    64     [ ! -f /var/run/ntp.pid ]; then
    62     [ ! -f /var/run/ntp.pid ]; then
    65         set -- "$@" -g
    63         set -- "$@" -g
    66 fi
    64 fi
    67 
    65 
    68 # Auth was off by default in xntpd now the default is on. Better have a way
    66 # Auth was off by default in xntpd now the default is on. Better have a way
    69 # to turn it off again. Also check for the obsolete "authenitcation" keyword.
    67 # to turn it off again. Also check for the obsolete "authentication" keyword.
    70 val=`svcprop -c -p config/no_auth_required $SMF_FMRI`
    68 val=`svcprop -c -p config/no_auth_required $SMF_FMRI`
    71 if [ ! "$val" = "true" ]; then
    69 if [ ! "$val" = "true" ]; then
    72         val=`/usr/bin/nawk '/^[ \t]*#/{next}
    70         val=`/usr/bin/nawk '/^[ \t]*#/{next}
    73             /^[ \t]*authentication[ \t]+no/ {
    71             /^[ \t]*authentication[ \t]+no/ {
    74                 printf("true", $2)
    72                 printf("true", $2)