Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/./man/man8/svcadm.8
Real path: /usr/share/man/man8/svcadm.8
Zurück
'\" te .\" Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. .TH svcadm 8 "16 Aug 2018" "Oracle Solaris 11.4" "System Administration Commands" .SH NAME svcadm \- manipulate service instances .SH SYNOPSIS .LP .nf \fB/usr/sbin/svcadm\fR [\fB-v\fR] enable [\fB-rt\fR] [\fB-s\fR [\fB-T\fR \fItimeout\fR]] {\fIFMRI\fR | \fIpattern\fR}... .fi .LP .nf \fB/usr/sbin/svcadm\fR [\fB-v\fR] disable [\fB-t\fR] [\fB-s\fR [\fB-T\fR \fItimeout\fR]] {\fIFMRI\fR | \fIpattern\fR}... .fi .LP .nf \fB/usr/sbin/svcadm\fR [\fB-v\fR] restart [\fB-s\fR [\fB-T\fR \fItimeout\fR]] {\fIFMRI\fR | \fIpattern\fR}... .fi .LP .nf \fB/usr/sbin/svcadm\fR [\fB-v\fR] refresh [\fB-s\fR [\fB-T\fR \fItimeout\fR]] {\fIFMRI\fR | \fIpattern\fR}... .fi .LP .nf \fB/usr/sbin/svcadm\fR [\fB-v\fR] clear [\fB-s\fR [\fB-T\fR \fItimeout\fR]] {\fIFMRI\fR | \fIpattern\fR}... .fi .LP .nf \fB/usr/sbin/svcadm\fR [\fB-v\fR] goals [\fB -s\fR [\fB-T\fR \fItimeout\fR]] [\fB -g\fR \fIgoal_FMRI\fR ] {\fB-c\fR | \fIFMRI\fR ...} .fi .LP .nf \fB/usr/sbin/svcadm\fR [\fB-v\fR] mark [\fB-It\fR] [\fB-s\fR [\fB-T\fR \fItimeout\fR]] \fIinstance_state\fR {\fIFMRI\fR | \fIpattern\fR}... .fi .LP .nf \fB/usr/sbin/svcadm\fR [\fB-v\fR] delegate [-s [\fB-T\fR \fItimeout\fR]] \fIrestarter_FMRI\fR \fIsvc\fR|\fIinst_FMRI\fR [ \fIsvc\fR|\fIinst_FMRI\fR ... ] .fi .LP .nf \fB/usr/sbin/svcadm\fR [\fB-v\fR] milestone [\fB-d\fR] [\fB-s\fR [\fB-T\fR \fItimeout\fR]] \fImilestone_FMRI\fR .fi .SH DESCRIPTION .sp .LP \fBsvcadm\fR issues requests for actions on services executing within the service management facility (see \fBsmf\fR(7) man page). Actions for a service are carried out by its assigned service restarter agent. The default service restarter is \fBsvc.startd\fR. For more information, see the \fBsvc.startd\fR(8) man page. .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-v\fR\fR .ad .RS 6n .rt Print actions verbosely to standard output. .RE .SH SUBCOMMANDS .SS "Common Operations" .sp .LP The subcommands listed below are used during the typical administration of a service instance. .sp .LP For subcommands taking one or more operands, if the operand specifies a service (instead of a service instance), and that service has only a single instance, \fBsvcadm\fR operates on that instance. If an abbreviated \fIFMRI\fR (a fault management resource identifier) or pattern matches more than one service, a warning message is displayed and that operand is ignored. For more information, see the \fBsmf\fR(7) man page. .sp .LP In the case that the service has more than one instance, \fBsvcadm\fR return a non-zero exit status. .sp .ne 2 .mk .na \fB\fBenable\fR \fB[\fR\fB-rt\fR\fB]\fR \fB[\fR\fB-s\fR \fB[\fR\fB-T\fR \fItimeout\fR\fB]\fR\fB]\fR {\fIFMRI\fR | \fIpattern\fR}. . .\fR .ad .br .sp .6 .RS 4n Enables the service instances specified by the operands. For each service instance, the assigned restarter will try to bring it to the online state. This action requires permission to modify the "general" property group of the service instance (see \fBsmf_security\fR(7) man page). .sp If the \fB-r\fR option is specified, \fBsvcadm\fR enables each service instance and recursively enables its dependencies. .sp If the \fB-s\fR option is specified, \fBsvcadm\fR enables each service instance and then waits for each service instance to enter the \fBonline\fR or \fBdegraded\fR state. \fBsvcadm\fR will return early if it determines that the service cannot reach these states without administrator intervention. .sp If the \fB-t\fR option is specified, \fBsvcadm\fR temporarily enables each service instance. Temporary enable only lasts until reboot. This action requires permission to modify the "restarter_actions" property group of the service instance (see \fBsmf_security\fR(7) man page). By default, \fBenable\fR is persistent across reboot. .sp If the \fB-T\fR option is specified along with the \fB-s\fR option, \fBsvcadm\fR will wait \fItimeout\fR seconds for the synchronous operation to complete. If \fItimeout\fR seconds pass and the action still has potential, \fBsvcadm\fR will return early. .RE .sp .ne 2 .mk .na \fB\fBdisable\fR [\fB-t\fR] \fB[\fR\fB-s\fR \fB[\fR\fB-T\fR \fItimeout\fR\fB]\fR\fB]\fR {\fIFMRI\fR | \fIpattern\fR}. . .\fR .ad .br .sp .6 .RS 4n Disables the service instance specified by the operands. For each service instance, the assigned restarter will try to bring it to the disabled state. If the service instance is already disabled but in the degraded state, the assigned restarter will retry the transition to the disabled state. This action requires permission to modify "general" property group of the service instance (see \fBsmf_security\fR(7) man page). .sp If the \fB-s\fR option is specified, \fBsvcadm\fR disables each service instance and then waits for each service instance to enter the disabled state. \fBsvcadm\fR will return early if it determines that the service cannot reach this state without administrator intervention. .sp If the \fB-t\fR option is specified, \fBsvcadm\fR temporarily disables each service instance. Temporary disable only lasts until reboot. This action requires permission to modify the "restarter_actions" property group of the service instance (see \fBsmf_security\fR(7) man page). By default, \fBdisable\fR is persistent across reboot. .sp If the \fB-T\fR option is specified along with the \fB-s\fR option, \fBsvcadm\fR will wait \fItimeout\fR seconds for the synchronous operation to complete. If \fItimeout\fR seconds pass and the action still has potential, \fBsvcadm\fR will return early. .RE .sp .ne 2 .mk .na \fB\fBrestart\fR \fB[\fR\fB-s\fR \fB[\fR\fB-T\fR \fItimeout\fR\fB]\fR\fB]\fR {\fIFMRI\fR | \fIpattern\fR}. . .\fR .ad .br .sp .6 .RS 4n Requests that the service instances specified by the operands be restarted. This action requires permission to modify the "restarter_actions" property group of the service instance (see \fBsmf_security\fR(7) man page). Restarting a service is implemented by most restarters as a full service "stop" followed by a "start". .sp This subcommand can restart only those services that are in the online or degraded states, as those states are defined in \fBsmf\fR(7) man page. .sp With the \fB-s\fR option, \fBsvcadm\fR will not return until each service instance reaches one of the online, degraded, or maintenance states, but not until first transitioning to an intermediate state. .sp If the \fB-T\fR option is specified along with the \fB-s\fR option, \fBsvcadm\fR will wait \fItimeout\fR seconds for the synchronous operation to complete. If \fItimeout\fR seconds pass and the action still has potential, \fBsvcadm\fR will return early. .RE .sp .ne 2 .mk .na \fB\fBrefresh\fR \fB[\fR\fB-s\fR \fB[\fR\fB-T\fR \fItimeout\fR\fB]\fR\fB]\fR {\fIFMRI\fR | \fIpattern\fR}. . .\fR .ad .br .sp .6 .RS 4n For each service instance specified by the operands, requests that the assigned restarter update the service's running configuration snapshot with the values from the current configuration. Some of these values take effect immediately (for example, dependency changes). Other values do not take effect until the next service \fBrestart\fR. See the restarter and service documentation for more information. .sp If the service is managed by \fBsvc.startd\fR(8), the \fBrefresh\fR method will be invoked if it exists to request the service reread its own configuration. For other restarters, see the restarter documentation. .sp This action requires permission to modify the "restarter_actions" property group of the service instance (see \fBsmf_security\fR(7) man page). .sp The \fB-s\fR option will cause \fBsvcadm\fR to wait until each service instance reaches either the online, maintenance, or degraded states. If any instance cannot transition to one of these states without further administrative action, \fBsvcadm\fR will return early. .sp If the \fB-T\fR option is specified along with the \fB-s\fR option, \fBsvcadm\fR will wait \fItimeout\fR seconds for the synchronous operation to complete. If \fItimeout\fR seconds pass and the action still has potential, \fBsvcadm\fR will return early. .RE .sp .ne 2 .mk .na \fB\fBclear\fR \fB[\fR\fB-s\fR \fB[\fR\fB-T\fR \fItimeout\fR\fB]\fR\fB]\fR {\fIFMRI\fR | \fIpattern\fR}. . .\fR .ad .br .sp .6 .RS 4n For each service instance specified by the operands, if the instance is in the \fBmaintenance\fR state, signal to the assigned restarter that the service has been repaired. If the instance is in the \fBdegraded\fR state, request that the assigned restarter take the service to the \fBonline\fR state. If the instance is in the \fBdegraded\fR state and also not enabled, request that the assigned restarter take the service to the \fBdisabled\fR state. This action requires permission to modify the "restarter_actions" property group of the service instance. For more information, see \fBsmf_security\fR(7) man page. .sp If the \fB-s\fR option is specified, \fBsvcadm\fR will not return until each service instance specified by the operands reaches the online state. If any instance cannot reach that state without further administrative action, \fBsvcadm\fR will return early. .sp If the \fB-T\fR option is specified along with the \fB-s\fR option, \fBsvcadm\fR will wait \fItimeout\fR seconds for the synchronous operation to complete. If \fItimeout\fR seconds pass and the action still has potential, \fBsvcadm\fR will return early. .RE .sp .ne 2 .mk .na \fB\fBgoals\fR [\fB-s\fR [\fB-T\fR \fItimeout\fR]] [\fB-g\fR \fIgoal_FMRI\fR] { \fB-c\fR | \fIFMRI\fR ... }\fR .ad .br .sp .6 .RS 4n Sets each FMRI in the operands as a dependency of \fIgoal_FMRI\fR. If the \fB-g\fR option is omitted, the subcommand will operate on the milestone/goals service. Attempts to set dependencies on services that are not set as goal service will fail. See the \fBsmf\fR(7) man page for an introduction of goal services. .sp If the option \fB-c\fR is used instead of FMRI, the administrative customizations on dependencies will be cleared. The dependencies will revert to what is delivered at the manifest and profile layers, according to the layers hierarchy. If the \fB-c\fR option is used on milestone/goals, its dependencies will revert to .sp .sp .in +2 .nf svc:/milestone/multi-user-server:default .fi .in -2 .sp All dependencies defined by this command will have grouping \fBrequire_all\fR and \fBrestart_on restart\fR. For more information, see the \fBsmf\fR(7) man page. Note that goals overwrites the existing dependencies of milestone/goals. Dependencies of milestone/goals or any goal services can be looked up with \fBsvcs -d FMRI\fR command. .sp The \fB-s\fR option will cause \fBsvcadm\fR to wait until the new set of dependencies is made effective by a synchronous refresh. If the refresh fails, \fBsvcadm\fR will return early. .sp If the \fB-T\fR option is specified along with the \fB-s\fR option, \fBsvcadm\fR will wait timeout seconds for the synchronous operation to complete. If timeout seconds pass and the action still has potential, \fBsvcadm\fR will return early. .sp In general, it is not recommend having milestone/goals depend on dynamically enabled services. Dynamically enabled services will lead to milestone/goals being in maintenance during boot until they are enabled by another service. Either set milestone/goals to a persistently enabled service, or manually change the dependency type to \fBoptional_all\fR by using \fBsvccfg\fR(8) command. .RE .SS "Exceptional Operations" .sp .LP The following subcommands are used for service development, management of services by higher level frameworks, and temporary administrative manipulation. .sp .ne 2 .mk .na \fB\fBdelegate\fR \fB[\fR\fB-s\fR \fB[\fR\fB-T\fR \fItimeout\fR\fB]\fR\fB]\fR \fIrestarter_FMRI\fR \fIsvc\fR|\fIinst_FMRI\fR [ \fIsvc\fR|\fIinst_FMRI\fR ... ]\fR .ad .br .sp .6 .RS 4n Change the restarter assignment for the given \fIinst_FMRI\fR to the restarter specified by \fIrestarter_FMRI\fR. The special token \fBmaster\fR will set the delegated restarter to the master restarter, \fBsvc.startd\fR(8). The special token \fBreset\fR will set the delegated restarter back to the original, file-backed restarter by removing the restarter customization. Redelegation requires a restart operation to take effect. Not all restarters support the same underlying application model, so not all potential delegations will result in a functioning service instance; see the manual page for the specific restarters involved in the operation to determine compatibility. .sp If the restarter does not exist or is disabled, the service instances will not be delegated and an error will be returned. If the restarter exists but is in an offline or maintenance state, the instances will be delegated but may not transition back to an online state. A warning message will be printed. .sp If the \fB-s\fR option is specified, \fBsvcadm\fR delegates each service instance and then waits for each service instance to enter the online state, if previously online, or waits for the general/restarter property group or property to be updated. \fBsvcadm\fR will return early if it determines that the service cannot reach these states without administrator intervention. .sp If the \fB-T\fR option is specified along with the \fB-s\fR option, \fBsvcadm\fR will wait \fItimeout\fR seconds for the synchronous operation to complete. If \fItimeout\fR seconds pass and the action still has potential, \fBsvcadm\fR will return early. .RE .sp .ne 2 .mk .na \fB\fBmark\fR [\fB-It\fR] \fB[\fR\fB-s\fR \fB[\fR\fB-T\fR \fItimeout\fR\fB]\fR\fB]\fR \fIinstance_state\fR {\fIFMRI\fR | \fIpattern\fR}. . .\fR .ad .br .sp .6 .RS 4n If \fIinstance_state\fR is "maintenance", then for each service specified by the operands, \fBsvcadm\fR requests that the assigned restarter place the service in the \fBmaintenance\fR state. See \fBsvc.startd\fR(8) and \fBinetd\fR(8) for a detailed description of the actions taken for each restarter. .sp If \fIinstance_state\fR is "degraded", then for services specified by the operands in the online state, \fBsvcadm\fR requests that the restarters assigned to the services move them into the \fBdegraded\fR state. .sp If the \fB-I\fR option is specified, the request is flagged as immediate. .sp The \fB-t\fR option is only valid for maintenance requests. When this option is specified, the request is flagged as temporary, and its effect will only last until the next reboot. .sp If the \fB-s\fR option is specified, \fBsvcadm\fR will not return until each service instance reaches either the maintenance or degraded state. .RE .sp .ne 2 .mk .na \fB\fBmilestone\fR [\fB-d\fR] \fB[\fR\fB-s\fR \fB[\fR\fB-T\fR \fItimeout\fR\fB]\fR\fB]\fR \fImilestone_FMRI\fR\fR .ad .br .sp .6 .RS 4n If \fImilestone_FMRI\fR is the keyword "none", all services other than the master restarter, \fBsvc:/system/svc/restarter:default\fR, will be temporarily disabled. .sp If \fImilestone_FMRI\fR is the keyword "all", temporary enable and disable requests for all services will be nullified. .sp If \fImilestone_FMRI\fR is one of the following: .sp .sp .in +2 .nf svc:/milestone/single-user:default svc:/milestone/multi-user:default svc:/milestone/multi-user-server:default .fi .in -2 .sp then temporary enable and disable requests for the indicated service and all services it depends on (directly or indirectly) will be nullified. All other services will be temporarily disabled. .sp Changing the system's current milestone with the "milestone" subcommand will not change the current run level of the system. To change the system's run level, invoke \fB/usr/sbin/init\fR directly. .sp This action requires permission to modify the "options_ovr" property group of the \fBsvc:/system/svc/restarter:default\fR service instance (see \fBsmf_security\fR(7) man page). .sp The \fB-d\fR option immediately changes the milestone to the requested milestone, as above. Additionally, it makes the specified milestone the default boot milestone, which persists across reboot. The default milestone is defined by the \fBoptions/milestone\fR property on the master restarter, \fBsvc:/system/svc/restarter:default\fR. If this property is absent, "all" is the default. This action requires permission to modify the "options" property group of the \fBsvc:/system/svc/restarter:default\fR service instance (see \fBsmf_security\fR(7) man page). .sp If the \fB-T\fR option is specified along with the \fB-s\fR option, \fBsvcadm\fR will wait \fItimeout\fR seconds for the synchronous operation to complete. If \fItimeout\fR seconds pass and the action still has potential, \fBsvcadm\fR will return early. .sp If the \fB-s\fR option is specified, \fBsvcadm\fR will change the system's milestone and then wait for the transition to the specified milestone to complete. If any service that needs to transition either to the online or disabled in order to reach the milestone cannot make the transition without administrative intervention, \fBsvcadm\fR will return early. .RE .SS "Operands" .sp .LP The following operands are supported: .sp .ne 2 .mk .na \fB\fIFMRI\fR\fR .ad .RS 11n .rt An \fIFMRI\fR that specifies one or more instances. \fIFMRI\fRs can be abbreviated by specifying the instance name, or the trailing portion of the service name. For example, given the \fIFMRI\fR: .sp .sp .in +2 .nf svc:/network/smtp:sendmail .fi .in -2 .sp All the following are valid abbreviations: .sp .sp .in +2 .nf sendmail :sendmail smtp smtp:sendmail network/smtp .fi .in -2 .sp While the following are invalid: .sp .sp .in +2 .nf mail network network/smt .fi .in -2 .sp If the \fIFMRI\fR specifies a service, then the command applies to all instances of that service. Abbreviated forms of \fIFMRI\fRs are unstable, and should not be used in scripts or other permanent tools. .RE .sp .ne 2 .mk .na \fB\fIpattern\fR\fR .ad .RS 11n .rt A pattern that is matched against the \fIFMRIs\fR of service instances according to the "globbing" rules described by \fBfnmatch\fR(7). If the pattern does not begin with "svc:", then "svc:/" is prepended. .RE .sp .LP If an abbreviated \fIFMRI\fR or pattern matches more than one service, a warning message is displayed and that operand is ignored. .sp .LP If multiple FMRI or pattern arguments are provided, no assumptions may be made about the order in which they will be processed. If operations on one FMRI might affect operations on another, as with some dependency relationships, those operations should be specified on separate command lines to enforce ordering. .sp .LP If the \fB-T\fR option is specified along with the \fB-s\fR option, \fBsvcadm\fR will wait \fItimeout\fR seconds for the synchronous operation to complete. If \fItimeout\fR seconds pass and the action still has potential, \fBsvcadm\fR will return early. .SH EXAMPLES .LP \fBExample 1\fR Restarting a Service Instance .sp .LP The following command restarts the \fBNFS\fR server. The full \fIFMRI\fR for the default service instance is: \fBsvc:/network/nfs/server:default\fR .sp .LP However, you can abbreviate the full \fIFMRI\fR as follows: .sp .in +2 .nf # svcadm restart nfs/server .fi .in -2 .sp .LP \fBExample 2\fR Disabling the Standard HTTP Server .sp .LP The following command disables the standard HTTP server, using an abbreviated \fIFMRI\fR: .sp .in +2 .nf $ svcadm disable http .fi .in -2 .sp .LP \fBExample 3\fR Enabling an Instance and Its Dependent Instances .sp .LP The following command enables the \fBfoo:bar\fR instance, and all instances on which it depends: .sp .in +2 .nf $ svcadm enable -r foo:bar .fi .in -2 .sp .LP \fBExample 4\fR Synchronously enabling an instance .sp .LP The following command enables the \fBfoo:bar\fR instance. The command will not return until the instance comes online or \fBsvcadm\fR determines it is not possible for the service to come online. .sp .in +2 .nf $ svcadm enable -s foo:bar .fi .in -2 .sp .LP \fBExample 5\fR Restricting and Restoring the Running Services .sp .LP The following command restricts the running services to single user mode: .sp .in +2 .nf # svcadm milestone milestone/single-user .fi .in -2 .sp .sp .LP The following command restores the running services: .sp .in +2 .nf # svcadm milestone all .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 .RS 5n .rt Successful completion. .RE .sp .ne 2 .mk .na \fB\fB1\fR\fR .ad .RS 5n .rt A fatal error occurred. One or more error messages are displayed on standard error. .RE .sp .ne 2 .mk .na \fB\fB2\fR\fR .ad .RS 5n .rt Invalid command line options were specified. .RE .sp .ne 2 .mk .na \fB\fB3\fR\fR .ad .RS 5n .rt \fBsvcadm\fR determined that a service instance that it was waiting for could not reach the desired state without administrator intervention due to a problem with the service instance itself. .RE .sp .ne 2 .mk .na \fB\fB4\fR\fR .ad .RS 5n .rt \fBsvcadm\fR determined that a service instance that it was waiting for could not reach the desired state without administrator intervention due to a problem with the service's dependencies. .RE .sp .ne 2 .mk .na \fB\fB5\fR\fR .ad .RS 5n .rt \fBsvcadm\fR reached the timeout while waiting for a service instance without the instance reaching the desired state despite having the potential to do so. .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 _ Interface Stability See below. .TE .sp .sp .LP The interactive output is Uncommitted. The invocation and non-interactive output are Committed. .SH SEE ALSO .sp .LP \fBsvcprop\fR(1), \fBsvcs\fR(1), \fBlibscf\fR(3LIB), \fBcontract\fR(5), \fBattributes\fR(7), \fBsmf\fR(7), \fBsmf_security\fR(7), \fBinetd\fR(8), \fBinit\fR(8), \fBsvc.startd\fR(8), \fBsvccfg\fR(8) .SH NOTES .sp .LP The amount of time \fBsvcadm\fR will spend waiting for services and their dependencies to change state is implicitly limited by their method timeouts. For example, a service using the default restarter whose start method hangs will be transitioned to the maintenance state when its timeout expires. \fBsvcadm\fR will then consider it impossible for this service to come online without administrator intervention. .sp .LP Attempts to synchronously enable a service which depends (directly or indirectly) on a file may fail with an exit status indicating that dependencies are unsatisfied if the caller does not have the privileges necessary to search the directory containing the file. This limitation may be removed in a future Solaris release.