JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Managing Services and Faults in Oracle Solaris 11.1     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Managing Services (Overview)

2.  Managing Services (Tasks)

Monitoring SMF Services

Monitoring Services (Task Map)

How to List the Status of a Service

How to List Customizations of a Service

How to Show Which Services Are Dependent on a Service Instance

How to Show Which Services a Service Is Dependent On

How to Set Up Notification of SMF Transition Events

Managing SMF Services

Managing SMF Services (Task Map)

Using RBAC Rights Profiles With SMF

How to Create an SMF Service

How to Disable a Service Instance

How to Enable a Service Instance

How to Restart a Service

How to Restore a Service That Is in the Maintenance State

How to Create an SMF Profile

How to Manually Create an SMF Profile

How to Apply an SMF Profile

Configuring SMF Services

Configuring SMF Services (Task Map)

How to Modify an SMF Service Property

How to Modify Multiple Properties for One Service

How to Modify a Service That Is Configured by a File

How to Change an Environment Variable for a Service

How to Change a Property for an inetd Controlled Service

How to Delete Customizations for a Service

How to Modify a Command-Line Argument for an inetd Controlled Service

How to Convert inetd.conf Entries

Using Run Control Scripts

Using Run Control Scripts (Task Map)

How to Use a Run Control Script to Stop or Start a Legacy Service

How to Add a Run Control Script

How to Disable a Run Control Script

How to Convert a Run Control Script to an SMF Service

Troubleshooting the Service Management Facility

Troubleshooting SMF (Task Map)

How to Debug a Service That Is Not Starting

How to Repair a Corrupt Repository

How to Boot Without Starting Any Services

How to Boot in Verbose Mode

How to Force an sulogin Prompt If the system/filesystem/local:default Service Fails During Boot

3.  Using the Fault Manager

Index

Configuring SMF Services

The following tasks show how to configure SMF services. In particular, how to modify service properties and other configuration information for a service or a service instance.

Configuring SMF Services (Task Map)

The following task map describes the procedures that are needed to configure SMF services.

Task
Description
For Instructions
Modify a service.
Modifies a service property of a specified service instance.
Modifies multiple properties of a specified service instance.
Modifies the configuration file of a service instance.
Modifies an environment variable of a service instance.
Deletes the customizations in the admin layer for a service.
Modify an inetd service.
Changes a configuration property of a service controlled by inetd.
Changes the startup options of a service controlled by inetd.
Convert inetd.conf entries.
Converts inetd services into legacy-run services that can be monitored using SMF.

How to Modify an SMF Service Property

This procedure shows how to modify the property that identifies the user that can start a service.

  1. Become an administrator or assume a role that includes the Service Management rights profile.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Change the value that is assigned to the start/user property.

    First, give the FMRI to identify the appropriate service. Next, assign the UID that will start the service.

    # svccfg -s FMRI
    svc:/service: setprop start/user = astring: newlogin
  3. Refresh the service.
    # svcadm refresh FMRI

How to Modify Multiple Properties for One Service

This procedure shows how to modify several service properties without having to type in as much information as the setprop subcommand requires. In this example, several DNS service properties are changed.

  1. Become an administrator or assume a role that includes the Service Management rights profile.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Change the property values.

    The editprop subcommand will gather the property groups and properties of specified service into a temporary file and the program named by the VISUAL or the EDITOR environment variable is invoked to edit it. See the svccfg(1M) man page for more information.

    # svccfg -s network/dns/client editprop
    
    ##
    ## The value used to construct the "nameserver" directive in resolv.conf(4).
    ##
    setprop config/nameserver = net_address: (192.168.1.10 192.168.1.11)
    
    ##
    ## The value used to construct the "search" directive in resolv.conf(4).
    ##
    # setprop config/search = astring: "example.com sales.example.com" 

    Do not save the file at this point.

  3. Apply the changes to all instances.

    Uncomment the refresh line at the bottom of the file to apply these changes when you save the file and exit the editor.

    ## Uncomment to apply these changes to all instances of this service.
    refresh

How to Modify a Service That Is Configured by a File

The following procedure shows how to change the configuration of a service that is not managed by the inetd service.

  1. Become an administrator or assume a role that includes the Service Management rights profile.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Make changes to the configuration files, as needed.

    Many of the services have one or more configuration files that are used to define the startup or other configuration information. These files can be changed while the service is running. The contents of the files is only checked when the service is started.

  3. Restart the service.
    # svcadm restart FMRI

Example 2-15 Adding a New NTP Server

To add a new NTP server to support your NTP clients, add a new entry for the server to the /etc/inet/ntp.conf file. Next, restart the NTP service. This example shows you what the ntp.conf file could look like, as well as how to restart the service.

# cat /etc/inet/ntp.conf
   .
   .
server ntpserver1.example.com
server ntpserver2.example.com
# svcadm restart svc:/network/ntp:default

How to Change an Environment Variable for a Service

This procedure shows how to modify cron environment variables to help with debugging.

  1. Become an administrator or assume a role that includes the Service Management rights profile.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Verify that the service is running.
    # svcs system/cron
    STATE          STIME    FMRI
    online         Dec_04   svc:/system/cron:default
  3. Set environment variables.

    In this example the UMEM_DEBUG and LD_PRELOAD environment variables are set. For information about the setenv subcommand refer to the svccfg(1M) man page.

    # svccfg -s system/cron:default setenv UMEM_DEBUG default
    # svccfg -s system/cron:default setenv LD_PRELOAD libumem.so
  4. Refresh and restart the service.
    # svcadm refresh system/cron
    # svcadm restart system/cron
  5. Verify that the change has been made.
    # pargs -e `pgrep -f /usr/sbin/cron`
    100657: /usr/sbin/cron
    envp[0]: LOGNAME=root
    envp[1]: LD_PRELOAD=libumem.so
    envp[2]: PATH=/usr/sbin:/usr/bin
    envp[3]: SMF_FMRI=svc:/system/cron:default
    envp[4]: SMF_METHOD=/lib/svc/method/svc-cron
    envp[5]: SMF_RESTARTER=svc:/system/svc/restarter:default
    envp[6]: TZ=GB
    envp[7]: UMEM_DEBUG=default

How to Change a Property for an inetd Controlled Service

  1. Become an administrator or assume a role that includes the Service Management rights profile.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. List the properties for the specific service.

    This command displays all of the properties for the service identified by the FMRI.

    # inetadm -l FMRI
  3. Change the property for the service.

    Each property for an inetd controlled service is defined by a property name and an assigned value. Supplying the property name without a specified value resets the property to the default value. Specific information about the properties for a service should be covered in the man page associated with the service.

    # inetadm -m FMRI property-name=value
  4. Verify that the property has changed.

    List the properties again to make sure that the appropriate change has occurred.

    # inetadm -l FMRI
  5. Confirm that the change has taken effect.

    Confirm the property change that the change has the desired effect.

Example 2-16 Changing the tcp_trace Property for telnet

The following example shows how to set the tcp_trace property for telnet to true. Checking the syslog output after running a telnet command shows that the change has taken effect.

# inetadm -l svc:/network/telnet:default
SCOPE    NAME=VALUE
         name="telnet"
 .
 .
default  inherit_env=TRUE
default  tcp_trace=FALSE
default  tcp_wrappers=FALSE
# inetadm -m svc:/network/telnet:default tcp_trace=TRUE
# inetadm -l svc:/network/telnet:default
SCOPE    NAME=VALUE
         name="telnet"
 .
 .
default  inherit_env=TRUE
         tcp_trace=TRUE
default  tcp_wrappers=FALSE
# telnet localhost
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
login: root
Password: 
.
.
.
Last login: Mon Jun 21 05:55:45 on console
Sun Microsystems Inc.   SunOS 5.10      s10_57  May 2004
# ^D
Connection to localhost closed by foreign host.
# tail -1 /var/adm/messages
Jun 21 06:04:57 yellow-19 inetd[100308]: [ID 317013 daemon.notice] telnet[100625]
    from 127.0.0.1 32802

How to Delete Customizations for a Service

Customizations can be removed from properties, property groups, and service instances.

Example 2-17 Removing Customizations from a Property

This example shows the effect of deleting customizations from a service. First we apply a customization to set the clean_vartmp property in the rmtmpfiles service so that /var/tmp gets cleaned during the boot process. As a privileged user type, the following commands:

# svccfg -s svc:/system/rmtmpfiles setprop options/clean_vartmp = true
# svcadm refresh svc:/system/rmtmpfiles

Next verify that the property has been changed:

$ svcprop -p options/clean_vartmp svc:/system/rmtmpfiles
true

To observe the customization, type the following commands:

$ svccfg -s svc:/system/rmtmpfiles listcust
options/clean_vartmp    boolean     admin      true
$ svcprop -p options/clean_vartmp -l all svc:/system/rmtmpfiles
options/clean_vartmp boolean manifest false
options/clean_vartmp boolean admin true

To remove the customization, type the following command as a privileged user:

# svccfg -s svc:/system/rmtmpfiles delcust options/clean_vartmp
 Deleting customizations for property: options/clean_vartmp

Now when you run the commands to observe the customization, you see:

$ svccfg -s svc:/system/rmtmpfiles listcust
$ svcprop -p options/clean_vartmp -l all svc:/system/rmtmpfiles
options/clean_vartmp boolean manifest false

How to Modify a Command-Line Argument for an inetd Controlled Service

  1. Become an administrator or assume a role that includes the Service Management rights profile.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. List the exec property for the specific service.

    This command displays all the properties for the service identified by the FMRI. Adding the grep command restricts the output to the exec property for the service.

    # inetadm -l FMRI|grep exec
  3. Change the exec property for the service.

    The command-syntax set with the exec property defines the command string that is run when the service is started.

    # inetadm -m FMRI exec="command-syntax"
  4. Verify that the property has changed.

    List the properties again to make sure that the appropriate change has occurred.

    # inetadm -l FMRI

How to Convert inetd.conf Entries

The following procedure converts inetd.conf entries into SMF service manifests. This procedure needs to be run any time a third-party application that depends on inetd is added to a system. Also run this procedure, if you need to make configuration changes to the entry in /etc/inetd.conf.

  1. Become an administrator or assume a role that includes the Service Management rights profile.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Convert the inetd.conf entries.

    The inetconv command converts each entry in the selected file into service manifests.

    # inetconv -i filename

Example 2-18 Converting /etc/inet/inetd.conf Entries into SMF Service Manifests

# inetconv -i /etc/inet/inetd.conf