Print this page
12721 would like svcadm disable -c
   1 '\" te
   2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" Copyright 2019 Joyent, Inc.
   4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   7 .TH SVCADM 1M "Oct 24, 2019"
   8 .SH NAME
   9 svcadm \- manipulate service instances
  10 .SH SYNOPSIS
  11 .nf
  12 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] enable [\fB-rst\fR]
  13      [{\fIFMRI\fR | \fIpattern\fR}...]
  14 .fi
  15 
  16 .LP
  17 .nf
  18 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] disable [\fB-st\fR]
  19      [{\fIFMRI\fR | \fIpattern\fR}...]
  20 .fi
  21 
  22 .LP
  23 .nf
  24 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] restart [\fB-d\fR]
  25      [{\fIFMRI\fR | \fIpattern\fR}...]
  26 .fi
  27 
  28 .LP
  29 .nf
  30 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] refresh
  31      [{\fIFMRI\fR | \fIpattern\fR}...]
  32 .fi
  33 
  34 .LP
  35 .nf
  36 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] clear
  37      [{\fIFMRI\fR | \fIpattern\fR}...]
  38 .fi
  39 


 125 service instance (see \fBsmf_security\fR(5)).
 126 .sp
 127 If the \fB-r\fR option is specified, \fBsvcadm\fR enables each service instance
 128 and recursively enables its dependencies.
 129 .sp
 130 If the \fB-s\fR option is specified, \fBsvcadm\fR enables each service instance
 131 and then waits for each service instance to enter the \fBonline\fR or
 132 \fBdegraded\fR state. \fBsvcadm\fR will return early if it determines that the
 133 service cannot reach these states without administrator intervention.
 134 .sp
 135 If the \fB-t\fR option is specified, \fBsvcadm\fR temporarily enables each
 136 service instance. Temporary enable only lasts until reboot. This action
 137 requires permission to modify the "restarter_actions" property group of the
 138 service instance (see \fBsmf_security\fR(5)). By default, \fBenable\fR is
 139 persistent across reboot.
 140 .RE
 141 
 142 .sp
 143 .ne 2
 144 .na
 145 \fB\fBdisable\fR [\fB-st\fR] {\fIFMRI\fR | \fIpattern\fR}...\fR
 146 .ad
 147 .sp .6
 148 .RS 4n
 149 Disables the service instance specified by the operands. For each service
 150 instance, the assigned restarter will try to bring it to the disabled state.
 151 This action requires permission to modify the "general" property group of the
 152 service instance (see \fBsmf_security\fR(5)).
 153 .sp
 154 If the \fB-s\fR option is specified, \fBsvcadm\fR disables each service
 155 instance and then waits for each service instance to enter the disabled state.
 156 \fBsvcadm\fR will return early if it determines that the service cannot reach
 157 this state without administrator intervention.
 158 .sp
 159 If the \fB-t\fR option is specified, \fBsvcadm\fR temporarily disables each
 160 service instance. Temporary disable only lasts until reboot. This action
 161 requires permission to modify the "restarter_actions" property group of the
 162 service instance (see \fBsmf_security\fR(5)). By default, \fBdisable\fR is
 163 persistent across reboot.





 164 .RE
 165 
 166 .sp
 167 .ne 2
 168 .na
 169 \fB\fBrestart\fR [\fB-d\fR] {\fIFMRI\fR | \fIpattern\fR}...\fR
 170 .ad
 171 .sp .6
 172 .RS 4n
 173 Requests that the service instances specified by the operands be restarted.
 174 This action requires permission to modify the "restarter_actions" property
 175 group of the service instance (see \fBsmf_security\fR(5)).
 176 .sp
 177 This subcommand can restart only those services that are in the online or
 178 degraded states, as those states are defined in \fBsmf\fR(5).
 179 .sp
 180 If the \fB-d\fR option is specified, the restarter sends a \fBSIGABRT\fR to all
 181 members of the contract, which should cause a core dump, before restarting
 182 the service.
 183 .RE


 362 .SH EXAMPLES
 363 \fBExample 1 \fRRestarting a Service Instance
 364 .sp
 365 .LP
 366 The following command restarts the \fBNFS\fR server. The full \fIFMRI\fR for
 367 the default service instance is: \fBsvc:/network/nfs/server:default\fR
 368 
 369 .sp
 370 .LP
 371 However, you can abbreviate the full \fIFMRI\fR as follows:
 372 
 373 .sp
 374 .in +2
 375 .nf
 376 # svcadm restart nfs/server
 377 .fi
 378 .in -2
 379 .sp
 380 
 381 .LP
 382 \fBExample 2 \fRDisabling the Standard HTTP Server
 383 .sp
 384 .LP
 385 The following command disables the standard HTTP server, using an abbreviated
 386 \fIFMRI\fR:
 387 
 388 .sp
 389 .in +2
 390 .nf
 391 $ svcadm disable http
 392 .fi
 393 .in -2
 394 .sp
 395 
 396 .LP
 397 \fBExample 3 \fREnabling an Instance and Its Dependent Instances
 398 .sp
 399 .LP
 400 The following command enables the \fBfoo:bar\fR instance, and all instances on
 401 which it depends:
 402 
 403 .sp
 404 .in +2
 405 .nf
 406 $ svcadm enable -r foo:bar
 407 .fi
 408 .in -2
 409 .sp
 410 
 411 .LP


   1 '\" te
   2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" Copyright 2020 Joyent, Inc.
   4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   7 .TH SVCADM 1M "May 11, 2020"
   8 .SH NAME
   9 svcadm \- manipulate service instances
  10 .SH SYNOPSIS
  11 .nf
  12 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] enable [\fB-rst\fR]
  13      [{\fIFMRI\fR | \fIpattern\fR}...]
  14 .fi
  15 
  16 .LP
  17 .nf
  18 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] disable
  19      [\fB-c\fR -\fIcomment\fR] [\fB-st\fR] [{\fIFMRI\fR | \fIpattern\fR}...]
  20 .fi
  21 
  22 .LP
  23 .nf
  24 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] restart [\fB-d\fR]
  25      [{\fIFMRI\fR | \fIpattern\fR}...]
  26 .fi
  27 
  28 .LP
  29 .nf
  30 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] refresh
  31      [{\fIFMRI\fR | \fIpattern\fR}...]
  32 .fi
  33 
  34 .LP
  35 .nf
  36 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] clear
  37      [{\fIFMRI\fR | \fIpattern\fR}...]
  38 .fi
  39 


 125 service instance (see \fBsmf_security\fR(5)).
 126 .sp
 127 If the \fB-r\fR option is specified, \fBsvcadm\fR enables each service instance
 128 and recursively enables its dependencies.
 129 .sp
 130 If the \fB-s\fR option is specified, \fBsvcadm\fR enables each service instance
 131 and then waits for each service instance to enter the \fBonline\fR or
 132 \fBdegraded\fR state. \fBsvcadm\fR will return early if it determines that the
 133 service cannot reach these states without administrator intervention.
 134 .sp
 135 If the \fB-t\fR option is specified, \fBsvcadm\fR temporarily enables each
 136 service instance. Temporary enable only lasts until reboot. This action
 137 requires permission to modify the "restarter_actions" property group of the
 138 service instance (see \fBsmf_security\fR(5)). By default, \fBenable\fR is
 139 persistent across reboot.
 140 .RE
 141 
 142 .sp
 143 .ne 2
 144 .na
 145 \fB\fBdisable\fR [\fB-c\fR \fIcomment\fR] [\fB-st\fR] {\fIFMRI\fR | \fIpattern\fR}...\fR
 146 .ad
 147 .sp .6
 148 .RS 4n
 149 Disables the service instance specified by the operands. For each service
 150 instance, the assigned restarter will try to bring it to the disabled state.
 151 This action requires permission to modify the "general" property group of the
 152 service instance (see \fBsmf_security\fR(5)).
 153 .sp
 154 If the \fB-s\fR option is specified, \fBsvcadm\fR disables each service
 155 instance and then waits for each service instance to enter the disabled state.
 156 \fBsvcadm\fR will return early if it determines that the service cannot reach
 157 this state without administrator intervention.
 158 .sp
 159 If the \fB-t\fR option is specified, \fBsvcadm\fR temporarily disables each
 160 service instance. Temporary disable only lasts until reboot. This action
 161 requires permission to modify the "restarter_actions" property group of the
 162 service instance (see \fBsmf_security\fR(5)). By default, \fBdisable\fR is
 163 persistent across reboot.
 164 .sp
 165 If the \fB-c\fR option is specified, the given free-form comment is recorded
 166 in the (temporary) service configuration under the \fBgeneral/comment\fR
 167 property.  This can serve as an administrator reason for disabling the service,
 168 and is reported by \fBsvcs\fR(1).
 169 .RE
 170 
 171 .sp
 172 .ne 2
 173 .na
 174 \fB\fBrestart\fR [\fB-d\fR] {\fIFMRI\fR | \fIpattern\fR}...\fR
 175 .ad
 176 .sp .6
 177 .RS 4n
 178 Requests that the service instances specified by the operands be restarted.
 179 This action requires permission to modify the "restarter_actions" property
 180 group of the service instance (see \fBsmf_security\fR(5)).
 181 .sp
 182 This subcommand can restart only those services that are in the online or
 183 degraded states, as those states are defined in \fBsmf\fR(5).
 184 .sp
 185 If the \fB-d\fR option is specified, the restarter sends a \fBSIGABRT\fR to all
 186 members of the contract, which should cause a core dump, before restarting
 187 the service.
 188 .RE


 367 .SH EXAMPLES
 368 \fBExample 1 \fRRestarting a Service Instance
 369 .sp
 370 .LP
 371 The following command restarts the \fBNFS\fR server. The full \fIFMRI\fR for
 372 the default service instance is: \fBsvc:/network/nfs/server:default\fR
 373 
 374 .sp
 375 .LP
 376 However, you can abbreviate the full \fIFMRI\fR as follows:
 377 
 378 .sp
 379 .in +2
 380 .nf
 381 # svcadm restart nfs/server
 382 .fi
 383 .in -2
 384 .sp
 385 
 386 .LP
 387 \fBExample 2 \fRDisabling a service
 388 .sp
 389 .LP
 390 The following command synchronously disables a service, using an abbreviated
 391 \fIFMRI\fR, and recording a ticket ID as the administrative reason:
 392 
 393 .sp
 394 .in +2
 395 .nf
 396 $ svcadm disable -c "OPS-1000" -s http
 397 .fi
 398 .in -2
 399 .sp
 400 
 401 .LP
 402 \fBExample 3 \fREnabling an Instance and Its Dependent Instances
 403 .sp
 404 .LP
 405 The following command enables the \fBfoo:bar\fR instance, and all instances on
 406 which it depends:
 407 
 408 .sp
 409 .in +2
 410 .nf
 411 $ svcadm enable -r foo:bar
 412 .fi
 413 .in -2
 414 .sp
 415 
 416 .LP