Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../.././../lib/svc/method/svc-nscd
Real path: /lib/svc/method/svc-nscd
Zurück
#!/usr/bin/ksh # # Copyright (c) 1994, 2022, Oracle and/or its affiliates. # . /lib/svc/share/smf_include.sh # Trusted Extensions non-global zones need special handling case "$1" in 'start') rm $SMF_SYSVOL_FS/name_service_door >/dev/null 2>&1 if (smf_is_system_labeled); then if (smf_is_nonglobalzone); then if [ ! -f /var/tsol/doors/nscd_per_label ]; then # Create a door to the global zone daemon. ln -s /var/tsol/doors/name_service_door \ $SMF_SYSVOL_FS || exit $SMF_EXIT_ERR_FATAL # If current service duration is not "transient", # create a dummy background process to preserve # contract lifetime. duration="" if /bin/svcprop -q -c -p startd/duration $SMF_FMRI then duration=`/bin/svcprop -c -p startd/duration \ $SMF_FMRI` fi if [ "$duration" != "transient" ]; then ( while true ; do sleep 3600 ; done ) & fi # The real daemon is not started in non-global zones, # so exit now. exit $SMF_EXIT_OK fi else rm /var/tsol/doors/name_service_door >/dev/null 2>&1 fi fi if is_self_assembly_boot; then # Only import on first boot after install/upgrade /usr/sbin/nscfg import -q $SMF_FMRI err=$? if [ $err -eq 1 ] ; then exec >& 2 echo "WARNING: $SMF_FMRI configuration import error." exit $SMF_EXIT_ERR_CONFIG elif [ $err -eq 3 ] ; then echo "WARNING: $SMF_FMRI no configuration." >& 2 exit $SMF_EXIT_ERR_CONFIG fi fi # Only export if allowed if [ -w /etc -a $(getconf _SC_SUNW_FEATURE_AK) == 0 ]; then # Force write of nsswitch.conf for effect (remove compat) /usr/sbin/nscfg export name-service/switch err=$? if [ $err -eq 1 ] ; then exec >& 2 echo "WARNING: svc:/name-service/switch" \ "configuration export error." exit $SMF_EXIT_ERR_CONFIG fi /usr/sbin/nscfg export $SMF_FMRI err=$? if [ $err -eq 1 ] ; then exec >& 2 echo "WARNING: $SMF_FMRI configuration export error." exit $SMF_EXIT_ERR_CONFIG fi fi # get CRC checksums of /etc/nsswitch.conf to know if it changes # during the nscd startup CRC1=`/usr/bin/cksum /etc/nsswitch.conf` /usr/sbin/nscd CRC2=`/usr/bin/cksum /etc/nsswitch.conf` # If /etc/nsswitch.conf was modified, due to a refresh of the # name-service/switch service in parallel, stop and restart nscd. # This is to cover the case that nscd read the file before # it's modified, so the file needs to be read again. if [ "$CRC1" != "$CRC2" ]; then echo "/etc/nsswitch.conf modified, restarting nscd ..." /usr/sbin/nscd -K /usr/sbin/nscd fi ;; 'refresh') if [[ $(getconf _SC_SUNW_FEATURE_AK) == 0 ]]; then # Force write of nsswitch.conf for effect (remove compat) /usr/sbin/nscfg export name-service/switch err=$? if [ $err -eq 1 ] ; then echo "WARNING: svc:/name-service/switch" \ "configuration export error." exit $SMF_EXIT_ERR_CONFIG fi # When we can't write the configuration file, we want an error. /usr/sbin/nscfg export $SMF_FMRI err=$? if [ $err -eq 2 ] ; then exit $SMF_EXIT_OK elif [ $err -ne 0 ] ; then echo "Unable to create /etc/nscd.conf" exit $SMF_EXIT_ERR_CONFIG fi fi /usr/bin/pgrep -z `smf_zonename` -x nscd && \ /usr/bin/pkill -HUP -z `smf_zonename` -x nscd exit $SMF_EXIT_OK ;; 'unconfigure') # Unroll any admin customization svccfg -s svc:/system/name-service/cache delcust if [ $? -ne 0 ]; then echo "Failed to unroll administrative customizations for $SMF_FMRI" exit $SMF_EXIT_ERR_FATAL fi # Revert legacy config to original state if [[ -w /etc ]]; then /usr/sbin/nscfg export $SMF_FMRI fi exit $SMF_EXIT_OK ;; *) echo "Usage: $0 { start | refresh | unconfigure }" exit 1 ;; esac