Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../.././../lib/svc/method/ipsec-policy-logger
Real path: /lib/svc/method/ipsec-policy-logger
Zurück
#!/usr/sbin/sh # # Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. # # # Script for svc:/network/ipsec/policy:logger service instance # # Load SMF constants and functions . /lib/svc/share/smf_include.sh . /lib/svc/share/pkg5_include.sh case "$1" in 'start') # # This service instance will disable itself if enabled in a local zone. # Dtrace in kernel mode is only supported for global zones. # if smf_is_nonglobalzone; then smf_method_exit $SMF_EXIT_TEMP_DISABLE global_zone_only \ "$SMF_FMRI is not supported in a local zone" solaris_cmd_cmd-inet fi # # If the DTrace script file exists, start it in the background. # stderr and stdout output both append to the file specified by # log_file. This allows DTrace dropped message errors to be logged # along with normal data. The file specified by log_file is created # by Dtrace if it doesn't exist. # log_file=`$SVCPROP -cp config/log_file svc:/network/ipsec/policy:logger` if [ -z "$log_file" ]; then echo "log_file name not set." exit $SMF_EXIT_ERR_FATAL fi log_rotation_size=`$SVCPROP -cp config/log_rotation_size svc:/network/ipsec/policy:logger` if [ "$log_rotation_size" -le 0 ]; then echo "Invalid log_rotation_size property. Value must be greater than 0." exit $SMF_EXIT_ERR_FATAL fi log_size_units=`$SVCPROP -cp config/log_size_units svc:/network/ipsec/policy:logger` log_level=`$SVCPROP -cp config/log_level svc:/network/ipsec/policy:logger` if [ -z "$log_level" ]; then echo "log_level not set." exit $SMF_EXIT_ERR_FATAL fi backtrace_depth=`$SVCPROP -cp config/backtrace_depth svc:/network/ipsec/policy:logger` if [ "$backtrace_depth" -le 0 ]; then echo "Invalid backtrace_depth property. Value must be greater than 0." exit $SMF_EXIT_ERR_FATAL fi script=`$SVCPROP -cp config/script svc:/network/ipsec/policy:logger` if [ -z "$script" ]; then echo "script name not set." exit $SMF_EXIT_ERR_FATAL fi # # When running under least privilege, a timestamp file in a writable # directory must be specified to avoid errors with the default # root-owned directory. log_ts_file="`dirname $log_file`/logger-ts" if [ ${#log_size_units} -gt 1 ]; then echo "Invalid log_size_units property. Single character expected." exit $SMF_EXIT_ERR_FATAL fi case $log_size_units in [^bBkKmMgG]) echo "Invalid log_size_units property value $log_size_units. Must be b, k, m or g" exit $SMF_EXIT_ERR_FATAL ;; esac /usr/sbin/logadm -s ${log_rotation_size}${log_size_units} -F ${log_ts_file} $log_file if [ -f "$script" ]; then exec 2>>$log_file /usr/sbin/dtrace -s $script -o $log_file -x stackframes=$backtrace_depth $log_level $backtrace_depth & else echo "Missing expected DTrace script $script" exit $SMF_EXIT_ERR_FATAL fi ;; *) echo "Usage: $0 start | refresh | stop" exit $SMF_EXIT_ERR_FATAL ;; esac exit $SMF_EXIT_OK