Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../.././../../../usr/man/man1/svcprop.1
Real path: /usr/share/man/man1/svcprop.1
Zurück
'\" te .\" Copyright (c) 2007, 2022, Oracle and/or its affiliates. .TH svcprop 1 "29 Nov 2022" "Oracle Solaris 11.4" "User Commands" .SH NAME svcprop \- retrieve values of service configuration properties .SH SYNOPSIS .LP .nf \fBsvcprop\fR [\fB-afqtv\fR] [\fB-C\fR | \fB-c\fR | \fB-s\fR \fIsnapshot\fR] [\fB-p\fR [\fIname\fR/]\fIname\fR]... [ \fB-g\fR \fIpgtype\fR]... \fB-l\fR \fIlayer\fR[,...] {\fIFMRI\fR | \fIpattern\fR}... .fi .LP .nf \fBsvcprop\fR [\fB-afqtv\fR] [\fB-C\fR | \fB-c\fR | \fB-s\fR \fIsnapshot\fR] [\fB-G\fR \fIname\fR [\fB-G\fR \fIname\fR]... [\fB-P\fR \fIname\fR]] [\fB-g\fR \fIpgtype\fR]... \fB-l\fR \fIlayer\fR[,...] {\fIFMRI\fR | \fIpattern\fR}... .fi .LP .nf \fBsvcprop\fR \fB-w\fR [\fB-fqtv\fR] [\fB-p\fR [\fIname\fR/]\fIname\fR] {\fIFMRI\fR | \fIpattern\fR} .fi .LP .nf \fBsvcprop\fR \fB-w\fR [\fB-fqtv\fR] [\fB-G\fR \fIname\fR [\fB-G\fR \fIname\fR]... [\fB-P\fR \fIname\fR]] {\fIFMRI\fR | \fIpattern\fR} .fi .SH DESCRIPTION .sp .LP The \fBsvcprop\fR utility prints values of properties in the \fBsmf\fR(7) service configuration repository. Properties are selected by \fB-p\fR options and the operands. The template property group types can be any one of the following: \fBtemplate\fR, \fBtemplate_pg_pattern\fR, and \fBtemplate_prop_pattern\fR. .sp .LP The default behavior of \fBsvcprop\fR without the \fB-C\fR, \fB-c\fR, or \fB-s\fR options is to access effective properties. .sp .LP The effective properties of a service consists of all the properties that are set on the service. .sp .LP The effective properties of a service instance includes properties in the composed view of its \fBrunning\fR snapshot (see \fBsmf\fR(7) for an explanation of property composition and snapshot states). A composed view of all the properties in the non-persistent property groups of the service instance are also included in the effective properties despite them not being part of the \fBrunning\fR snapshot. If the \fBrunning\fR snapshot does not exist then the instance's directly attached properties are used instead. A directly attached property is an uncommitted property whch has been set on the instance or on the parent service but the instance has not been refreshed. .sp .LP If the FMRI specifies a property, composition is not used to determine the effective property as it is fully specified by the FMRI. .SS "Output Format" .sp .LP By default, when a single property is selected, the values for each are printed on separate lines. Empty \fBASCII\fR string values are represented by a pair of double quotes (\fB"\|"\fR). Bourne shell metacharacters ('\fB;\fR', '\fB&\fR', '\fB(\fR', '\fB)\fR', '\fB|\fR', '\fB^\fR', '\fB<\fR', '\fB>\fR', newline, space, tab, backslash, '\fB"\fR', single-quote, '\fB`\fR') in \fBASCII\fR string values are quoted by backslashes (\fB\e\fR). .sp .LP When multiple properties are selected, a single line is printed for each. Each line comprises a property designator, a property type, and the values (as described above), separated by spaces. By default, if a single \fIFMRI\fR operand has been supplied, the property designator consists of the property group name and the property name joined by a slash (\fB/\fR). If multiple \fIFMRI\fR operands are supplied, the designator is the canonical \fIFMRI\fR for the property. .sp .LP If access controls prohibit reading the value of a property, and no property or property group is specified explicitly by a \fB-p\fR option, the property is displayed as if it had no values. If one or more property or property group names is specified by a \fB-p\fR option, and any property value cannot be read due to access controls, an error results. .sp .LP Error messages are printed to the standard error stream. .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-a\fR\fR .ad .br .sp .6 .RS 4n Display all properties, including those in SMF template definition property groups. .RE .sp .ne 2 .mk .na \fB\fB-C\fR\fR .ad .br .sp .6 .RS 4n Uses the directly attached properties, without composition. .RE .sp .ne 2 .mk .na \fB\fB-c\fR\fR .ad .br .sp .6 .RS 4n For service instances, uses the composed view of their directly attached properties. .RE .sp .ne 2 .mk .na \fB\fB-f\fR\fR .ad .br .sp .6 .RS 4n Selects the multi-property output format, with full FMRIs as designators. .RE .sp .ne 2 .mk .na \fB\fB-G\fR \fBpg\fR [\fB-G\fR \fBpg\fR ...]\fR .ad .br .sp .6 .RS 4n For each service or service instance specified by the operands, selects all properties in the \fBpg\fR property group. If used with the \fB-g\fR option, selects the \fBpg\fR property for all matching property group types. The pg specified may not be a pattern. When multiple \fB-G\fR options appear then the options indicate how to traverse the property group hierarchy. .RE .sp .ne 2 .mk .na \fB\fB-G\fR \fBpg\fR [\fB-G\fR \fBpg\fR ...] \fB-P\fR \fBprop\fR\fR .ad .br .sp .6 .RS 4n Selects property \fBprop\fR in property group \fBpg\fR for each of the services or service instances specified by the operands. Neither the \fBpg\fR nor the \fBprop\fR specified may be a pattern. When multiple \fB-G\fR options appear, then the options indicate how to traverse the property group hierarchy. .RE .sp .ne 2 .mk .na \fB\fB-g\fR \fIpgtype\fR\fR .ad .br .sp .6 .RS 4n Display only properties that belong to property groups of type \fIpgtype\fR. Multiple \fB-g\fR options will display properties from multiple properties group types. This option implies multi-property output format (\fB-t\fR). .RE .sp .ne 2 .mk .na \fB\fB-l\fR \fIlayer\fR[,...]\fR .ad .br .sp .6 .RS 4n Display only the properties defined at the selected layers. Available layers are \fBmanifest\fR, \fBsystem-profile\fR, \fBenterprise-profile\fR, \fBsite-profile\fR, \fBnode-profile\fR, \fBsysconfig-profile\fR, and \fBadmin\fR. The alias \fBall\fR is available to select all layers. Properties that belong to non-persistent property groups will not be displayed when this option is used. .RE .sp .ne 2 .mk .na \fB\fB-p\fR \fIname\fR\fR .ad .br .sp .6 .RS 4n For each service or service instance specified by the operands, selects all properties in the \fIname\fR property group. For property groups specified by the operands, selects the \fIname\fR property. If used with \fB-g\fR, selects the \fIname\fR property for all matching property group types. The property group name, and the property \fIname\fR when specified, must be encoded if a reserved character is used. For more information, see the \fBsmf\fR(7) man page. .RE .sp .ne 2 .mk .na \fB\fB-p\fR \fIpg\fR/\fIprop\fR\fR .ad .br .sp .6 .RS 4n Selects property \fIprop\fR in property group \fIpg\fR for each of the services or service instances specified by the operands. .sp If \fB-p\fR is not used to specifically select a property or property group, \fBsvcprop\fR will not print SMF template definition properties. More SMF infrastructure properties may be hidden from the default output in future releases. If \fB-a\fR is used, all properties, including SMF template definition properties, will be displayed. .RE .sp .ne 2 .mk .na \fB\fB-q\fR\fR .ad .br .sp .6 .RS 4n Quiet. Produces no output. .RE .sp .ne 2 .mk .na \fB\fB-s\fR \fIname\fR\fR .ad .br .sp .6 .RS 4n Uses the composed view of the \fIname\fR snapshot for service instances. .RE .sp .ne 2 .mk .na \fB\fB-t\fR\fR .ad .br .sp .6 .RS 4n Selects the multi-property output format. .RE .sp .ne 2 .mk .na \fB\fB-v\fR\fR .ad .br .sp .6 .RS 4n Verbose. Prints error messages for non-existent properties, even if option -q is also used. .RE .sp .ne 2 .mk .na \fB\fB-w\fR\fR .ad .br .sp .6 .RS 4n Waits until the specified property group or the property group containing the specified property changes before printing. .sp This option is only valid when a single entity is specified. If more than one operand is specified, or an operand matches more than one instance, an error message is printed and no action is taken. The \fB-C\fR option is implied. .RE .SH OPERANDS .sp .LP The following operands are supported: .sp .ne 2 .mk .na \fB\fIFMRI\fR\fR .ad .br .sp .6 .RS 4n The FMRI of a service, a service instance, a property group, or a property. .sp Instances and services can be abbreviated by specifying the instance name, or the trailing portion of the service name. Properties and property groups must be specified by a full FMRI. For example, given the FMRI: .sp .sp .in +2 .nf svc:/network/smtp:sendmail .fi .in -2 .sp The following are valid abbreviations: .sp .sp .in +2 .nf sendmail :sendmail smtp smtp:sendmail network/smtp .fi .in -2 .sp The following are invalid abbreviations: .sp .sp .in +2 .nf mailnetwork network/smt .fi .in -2 .sp Abbreviated forms of FMRIs are Uncommitted and should not be used in scripts or other permanent tools. If an abbreviation matches multiple instances, \fBsvcprop\fR acts on each instance. .RE .sp .ne 2 .mk .na \fBpattern\fR .ad .br .sp .6 .RS 4n A glob pattern which is matched against the FMRIs of services and instances in the repository. See \fBfnmatch\fR(7). If a pattern exactly matches a service name, \fBsvcprop\fR acts on that service. If the pattern matches multiple services or instances, \fBsvcprop\fR acts on each service or instance. .RE .SH EXAMPLES .LP \fBExample 1\fR Displaying the Value of a Single Property .sp .LP The following example displays the value of the state property in the restarter property group of instance \fBdefault\fR of service \fBsystem/cron\fR. .sp .in +2 .nf example% \fBsvcprop -p restarter/state system/cron:default\fR online .fi .in -2 .sp .LP \fBExample 2\fR Determine if a Service is Enabled .sp .LP Inspect the \fBgeneral/enabled\fR property to determine if the service is enabled. This property takes immediate effect, so the \fB-c\fR option must be used as some properties may be inherited: .sp .in +2 .nf example% \fBsvcprop -c -p general/enabled system/cron:default\fR true .fi .in -2 .sp .sp .LP See smf(7) for a description of composition. .LP \fBExample 3\fR Displaying All Properties in a Property Group .sp .LP On a default installation of Solaris, the following example displays all properties in the \fBgeneral\fR property group of each instance of the \fBnetwork/ntp\fR service: .sp .in +2 .nf example% \fBsvcprop -p general ntp\fR general/enabled boolean true general/action_authorization astring solaris.smf.manage.ntp general/entity_stability astring Uncommitted general/single_instance boolean true general/value_authorization astring solaris.smf.value.ntp .fi .in -2 .sp .LP \fBExample 4\fR Testing the Existence of a Property .sp .LP The following example tests the existence of the \fBgeneral/enabled\fR property for all instances of service identity: .sp .in +2 .nf example% \fBsvcprop -q -p general/enabled identity:\fR example% \fBecho $?\fR 0 .fi .in -2 .sp .LP \fBExample 5\fR Waiting for Property Change .sp .LP The following example waits for the \fBsendmail\fR instance to change state. .sp .in +2 .nf example% \fBsvcprop -w -p restarter/state sendmail\fR .fi .in -2 .sp .LP \fBExample 6\fR Retrieving the Value of a Boolean Property in a Script .sp .LP The following example retrieves the value of a boolean property in a script: .sp .in +2 .nf set -- `svcprop -c -t -p general/enabled service` code=$? if [ $code -ne 0 ]; then echo "svcprop failed with exit code $code" return 1 fi if [ $2 != boolean ]; then echo "general/enabled has unexpected type $2" return 2 fi if [ $# -ne 3 ]; then echo "general/enabled has wrong number of values" return 3 fi value=$3 \&... .fi .in -2 .sp .LP \fBExample 7\fR Using \fBsvcprop\fR in a Script .sp .LP The following example gets the value of a service property and uses it in a script (\fB/usr/bin/Xserver\fR): .sp .in +2 .nf fmri=$1 prop=$2 if svcprop -q -p ${prop} ${fmri} ; then propval="$(svcprop -p ${prop} "${fmri}")" if [[ "${propval}" == "\e"\e"" ]] ; then propval="" fi fi .fi .in -2 .sp .LP \fBExample 8\fR Filtering Output by Property Group Type .sp .LP The following example gets the methods for \fBsvc:/network/ssh:default\fR .sp .in +2 .nf example% \fBsvcprop -p exec -g method svc:/network/ssh:default\fR start/exec astring /lib/svc/method/sshd\e start stop/exec astring :kill refresh/exec astring /lib/svc/method/sshd\e restart unconfigure/exec astring /lib/svc/method/sshd\e -u .fi .in -2 .sp .LP \fBExample 9\fR Displaying Administratively Customized Properties .sp .LP The following command uses SMF layers to display administratively customized properties. .sp .in +2 .nf example% \fBsvcprop -p config -l admin svc:/network/dns/client\fR config/domain astring admin corp.example.com config/nameserver net_address admin 10.22.33.44 10.44.33.11 .fi .in -2 .sp .LP \fBExample 10\fR Displaying the Value of a Single Property with Reserved Characters .sp .LP The following example displays the value of the \fBcurrent state\fR property in the \fBconfig\fR property group of instance \fBinst\fR of service \fBsvc\fR. .sp .in +2 .nf example% \fBsvcprop -p config/current%20state svc:inst\fR starting .fi .in -2 .sp .sp .LP If specifying the property name unambiguously. then the same command may be written without the encoding by using the \fB-G\fR and \fB-P\fR options: .sp .in +2 .nf example% \fBsvcprop -G config -P "current state" svc:inst\fR starting .fi .in -2 .sp .LP \fBExample 11\fR Displaying All Properties in a Nested Property Group .sp .LP For a service named \fIdemo\fR with a property group named \fIpgb\fR that is nested within a property group named \fIpga\fR, the following example would display all properties in the \fIpgb\fR property group in the default instance. .sp .in +2 .nf example% \fBsvcprop -p pga/pgb demo\fR pga/pgb/property astring 123 .fi .in -2 .sp .sp .LP If specifying the property group name unambiguously then the same command may be written by using the \fB-G\fR options: .sp .in +2 .nf example% \fBsvcprop -G pga -G pgb demo\fR pga/pgb/property astring 123 .fi .in -2 .sp .SH EXIT STATUS .sp .LP The following exit values are returned: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .br .sp .6 .RS 4n Successful completion. .RE .sp .ne 2 .mk .na \fB\fB1\fR\fR .ad .br .sp .6 .RS 4n An error occurred. .RE .sp .ne 2 .mk .na \fB\fB2\fR\fR .ad .br .sp .6 .RS 4n Invalid command line options were specified. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Availability system/core-os .TE .sp .SH SEE ALSO .sp .LP \fBsvcs\fR(1), \fBservice_bundle\fR(5), \fBattributes\fR(7), \fBfnmatch\fR(7), \fBsmf\fR(7), \fBsmf_method\fR(7), \fBsmf_security\fR(7), \fBinetd\fR(8), \fBsvc.startd\fR(8), \fBsvcadm\fR(8), \fBsvccfg\fR(8) .SH HISTORY .sp .LP The \fB-G\fR and \fB-P\fR options were added in Oracle Solaris 11.4.0. .sp .LP The \fB-a\fR, \fB-g\fR, and \fB-l\fR options were added in Oracle Solaris 11.1.0. .sp .LP The \fBsvcprop\fR command, with support for the \fB-C\fR, \fB-c\fR, \fB-f\fR, \fB-p\fR, \fB-q\fR, \fB-s\fR, \fB-t\fR, \fB-v\fR, and \fB-w\fR options, was introduced in Solaris 10 3/05.