Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../.././lib/svc/method/yp
Real path: /lib/svc/method/yp
Zurück
#!/bin/sh # # Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. # . /lib/svc/share/smf_include.sh YPDIR=/usr/lib/netsvc/yp service_is_running() { svc_state=`svcs -H -o state $1` if [ $? -ne 0 ]; then return 2 fi if [ "$svc_state" = "online" -o "$svc_state" = "degraded" ]; then return 0 else return 1 fi } case $SMF_FMRI in 'svc:/network/nis/client:default') case "$1" in 'start') domain=`domainname` if [ -z "$domain" ]; then echo "$0: domainname not set" exit $SMF_EXIT_ERR_CONFIG fi # Since two ypbinds will cause ypwhich to hang... if pgrep -z `smf_zonename` ypbind >/dev/null; then echo "$0: ypbind is already running." exit $SMF_EXIT_ERR_CONFIG fi prop="config/use_broadcast" propval=`svcprop -p $prop $SMF_FMRI 2>/dev/null` if [ "$propval" = "true" ] ; then ypargs="-broadcast" elif [ -f /var/yp/binding/$domain/ypservers ]; then ypargs="" else ypargs="-broadcast" fi propval="" prop="config/use_ypsetme" propval=`svcprop -p $prop $SMF_FMRI 2>/dev/null` if [ "$propval" = "true" ] ; then ypargs="$ypargs -ypsetme" fi $YPDIR/ypbind $ypargs > /dev/null 2>&1 rc=$? if [ $rc != 0 ]; then echo "$0: ypbind failed with $rc" exit 1 fi ;; 'unconfigure') # Permanently shutdown service svcadm disable $SMF_FMRI # Unroll any admin customization svccfg -s svc:/network/nis/client delcust if [ $? -ne 0 ]; then echo "Failed to unroll administrative customizations for $SMF_FMRI" exit $SMF_EXIT_ERR_FATAL fi svcadm refresh $SMF_FMRI ;; esac ;; 'svc:/network/nis/server:default') case "$1" in 'start') domain=`domainname` if [ -z "$domain" ]; then echo "$0: domainname not set" exit $SMF_EXIT_ERR_CONFIG fi if [ ! -d /var/yp/$domain ]; then echo "$0: domain directory missing" exit $SMF_EXIT_ERR_CONFIG fi if service_is_running 'svc:/network/dns/client:default'; then $YPDIR/ypserv -d else $YPDIR/ypserv fi rc=$? if [ $rc != 0 ]; then echo "$0: ypserv failed with $rc" exit 1 fi ;; 'unconfigure') domain=`domainname` # Permanently shutdown service svcadm disable $SMF_FMRI # Unroll any admin customization svccfg -s svc:/network/nis/server delcust if [ $? -ne 0 ]; then echo "Failed to unroll administrative customizations for $SMF_FMRI" exit $SMF_EXIT_ERR_FATAL fi svcadm refresh $SMF_FMRI if [ -n "$domain" ]; then rm -rf /var/yp/$domain/*.* fi ;; esac ;; 'svc:/network/nis/passwd:default') PWDIR=`grep "^PWDIR" /var/yp/Makefile 2> /dev/null` \ && PWDIR=`expr "$PWDIR" : '.*=[ ]*\([^ ]*\)'` if [ "$PWDIR" ]; then if [ "$PWDIR" = "/etc" ]; then unset PWDIR else PWDIR="-D $PWDIR" fi fi $YPDIR/rpc.yppasswdd $PWDIR -m rc=$? if [ $rc != 0 ]; then echo "$0: rpc.yppasswdd failed with $rc" exit 1 fi ;; *) echo "$0: Unknown service \"$SMF_FMRI\"." exit $SMF_EXIT_ERR_CONFIG ;; esac exit $SMF_EXIT_OK