<?Pub UDT _bookmark _target?><?Pub UDT __target_1 _target?><?Pub UDT registeredtm trademark?><chapter id="faauf"><?Pub Tag atict:info tracking="off" ref="4"?><?Pub Tag atict:user
user="sk23612" fullname="Juanita Heieck"?><?Pub Tag atict:user user="jonj"
fullname="Juanita Heieck"?><?Pub Tag atict:user user="smorgan" fullname=""?><?Pub Tag
atict:user user="kathys" fullname="Kathy Slattery"?><?Pub Tag atict:user
user="cindys" fullname=""?><?Pub Tag atict:user user="cathleen" fullname=""?><?Pub Tag
atict:user user="eb151805" fullname="Juanita Heieck"?><?Pub Tag atict:user
user="jh118764" fullname="Juanita Heieck"?><?Pub Tag atict:user user="lh136763"
fullname="Laura Hartman"?><?Pub Tag atict:user user="wsm" fullname=""?><title>Managing
Services (Tasks)</title><highlights><itemizedlist><para>This chapter covers the tasks required to manage and monitor the Service
Management Facility (SMF). In addition, information that is related to managing
run level scripts is provided. The following topics are covered:</para><listitem><para><olink targetptr="eqbrp" remap="internal">Managing Services (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="dzhaq" remap="internal">Monitoring SMF Services</olink></para>
</listitem><listitem><para><olink targetptr="eqbrs" remap="internal">Managing SMF Services</olink></para>
</listitem><listitem><para><olink targetptr="eqbwh" remap="internal">Configuring SMF Services</olink></para>
</listitem><listitem><para><olink targetptr="fahqr" remap="internal">Using Run Control Scripts</olink></para>
</listitem><listitem><para><olink targetptr="ecdps" remap="internal">Troubleshooting the Service Management
Facility</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="eqbrp"><title>Managing Services (Task Map)</title><para>The following task map describes the procedures that are needed to use
SMF.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colwidth="33*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Display the status of a service instance.</para>
</entry><entry><para>Displays the status of all running service instances.</para>
</entry><entry><para><olink targetptr="ecdne" remap="internal">How to List the Status of a Service</olink></para>
</entry>
</row><row><entry><para>Display the service dependents.</para>
</entry><entry><para>Display the services that are dependent on the specified service.</para>
</entry><entry><para><olink targetptr="eqbse" remap="internal">How to Show Which Services Are Dependent on
a Service Instance</olink></para>
</entry>
</row><row><entry><para>Display the dependencies of a service.</para>
</entry><entry><para>Display the services that a specified service is dependent on. This
information can be used to help identify what is preventing a service from
starting.</para>
</entry><entry><para><olink targetptr="eqbsf" remap="internal">How to Show Which Services a Service Is Dependent
On</olink></para>
</entry>
</row><row><entry><para>Disable a service instance.</para>
</entry><entry><para>Turns off a service that is not functioning properly or needs to be
off to increase security.</para>
</entry><entry><para><olink targetptr="ecdqs" remap="internal">How to Disable a Service Instance</olink></para>
</entry>
</row><row><entry><para>Enable a service instance</para>
</entry><entry><para>Starts a service.</para>
</entry><entry><para><olink targetptr="ecdia" remap="internal">How to Enable a Service Instance</olink></para>
</entry>
</row><row><entry><para>Restart a service instance.</para>
</entry><entry><para>Restart a service, without having to use separate commands to disable
and then enable the service.</para>
</entry><entry><para><olink targetptr="eywvo" remap="internal">How to Restart a Service</olink></para>
</entry>
</row><row rowsep="0"><entry><para>Modify a service instance.</para>
</entry><entry><para>Modifies the configuration parameters of a specified service instance.</para>
</entry><entry><para><olink targetptr="ecdhr" remap="internal">How to Modify a Service</olink></para>
</entry>
</row><row rowsep="0"><entry>
</entry><entry><para>Changes a configuration property of a service controlled by <literal>inetd</literal>.</para>
</entry><entry><para><olink targetptr="euprm" remap="internal">How to Change a Property for an inetd Controlled
Service</olink></para>
</entry>
</row><row><entry>
</entry><entry><para>Changes the startup options of a service controlled by <command>inetd</command>.</para>
</entry><entry><para><olink targetptr="eupri" remap="internal">How to Modify a Command-Line Argument for an
inetd Controlled Service</olink></para>
</entry>
</row><row><entry><para>Convert <filename>inetd.conf</filename> entries.</para>
</entry><entry><para>Converts <command>inetd</command> services into legacy-run services
that can be monitored using SMF.</para>
</entry><entry><para><olink targetptr="epubw" remap="internal">How to Convert inetd.conf Entries</olink></para>
</entry>
</row><row><entry><para>Repair a corrupt service configuration repository.</para>
</entry><entry><para>Replaces a corrupt repository with a default version.</para>
</entry><entry><para><olink targetptr="ecduh" remap="internal">How to Repair a Corrupt Repository</olink></para>
</entry>
</row><row><entry><para>Boot a system without starting any services.</para>
</entry><entry><para>Boots a system without starting any services so that configuration problems
that prevent booting can be fixed.</para>
</entry><entry><para><olink targetptr="ecdwu" remap="internal">How to Boot Without Starting Any Services</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="dzhaq"><title>Monitoring SMF Services</title><para>The following tasks show how to monitor SMF services.</para><task id="ecdne"><title>How to List the Status of a Service</title><tasksummary><para>This procedure can be used to show what services are running.</para>
</tasksummary><procedure remap="single-step"><step><para>Run the <command>svcs</command> command.</para><para>Running this
command without any options displays a status report of the service specified
by the FMRI.</para><screen>% svcs -l <replaceable>FMRI</replaceable></screen>
</step>
</procedure><example id="eqbru"><title>Showing the Status of the <command>rlogin</command> Service</title><para>This example shows the status of a service that includes many contracts.</para><screen>% <userinput>svcs -l network/login:rlogin</userinput>
fmri         svc:/network/login:rlogin
enabled      true
state        online
next_state   none
restarter    svc:/network/inetd:/default
contract_id  42325 41441 40776 40348 40282 40197 39025 38381 38053\
 33697 28625 24652 23689 15352 9889 7194 6576 6360 5387 1475 3015\
 6545 6612 9302 9662 10484 16254 19850 22512 23394 25876 26113 27326\
 34284 37939 38405 38972 39200 40503 40579 41129 41194</screen>
</example><example id="fahoz"><title>Showing the Status of the <command>sendmail</command> Service</title><para>This example shows the status of a service that includes dependencies.</para><screen>% <userinput>svcs -l network/smtp:sendmail</userinput>
fmri         svc:/network/smtp:sendmail
enabled      true
state        online
next_state   none
restarter    svc:/system/svc/restarter:default
contract_id  29462 
dependency   require_all/refresh file://localhost/etc/nsswitch.conf (-)
dependency   require_all/refresh file://localhost/etc/mail/sendmail.cf (-)
dependency   optional_all/none svc:/system/system-log (online)
dependency   require_all/refresh svc:/system/identity:domain (online)
dependency   require_all/refresh svc:/milestone/name-services (online)
dependency   require_all/none svc:/network/service (online)
dependency   require_all/none svc:/system/filesystem/local (online)</screen>
</example><example id="eqbrn"><title>Showing the Status of all Services</title><para>The following command lists all services that are installed on the system
as well as the status of each service. The command displays those services
that are disabled as well as those that are enabled.</para><screen>% <userinput>svcs -a</userinput></screen>
</example><example id="euprl"><title>Showing the Status of Services Controlled by <command>inetd</command></title><para>The following command lists services that are controlled by <command>inetd</command>.
Each service's FMRI is listed, along with the run state and whether the service
is enabled or disabled.</para><screen>% <userinput>inetadm</userinput></screen>
</example>
</task><task id="eqbse"><title>How to Show Which Services Are Dependent on a Service
Instance</title><tasksummary><para>This procedure shows how to determine which service instances depend
on the specified service.</para>
</tasksummary><procedure remap="single-step"><step><para>Display the service dependents.</para><screen>% svcs -D <replaceable>FMRI</replaceable></screen>
</step>
</procedure><example id="eqbsg"><title>Displaying the Service Instances That Are Dependent on the Multiuser
Milestone</title><para>The following example shows how to determine which service instances
are dependent on the multiuser milestone.</para><screen>% <userinput>svcs -D milestone/multi-user</userinput>
STATE          STIME    FMRI
online         Apr_08   svc:/milestone/multi-user-server:default</screen>
</example>
</task><task id="eqbsf"><title>How to Show Which Services a Service Is Dependent
On</title><tasksummary><para>This procedure shows how to determine which services a specified service
instance is dependent on.</para>
</tasksummary><procedure remap="single-step"><step><para>Display the service dependencies.</para><screen>% svcs -d <replaceable>FMRI</replaceable></screen>
</step>
</procedure><example id="eqqeb"><title>Displaying the Service Instances That the Multiuser Milestone Is Dependent
On</title><para>The following example shows the services instances that the multiuser
milestone is dependent on.</para><screen>% <userinput>svcs -d milestone/multi-user:default</userinput>
STATE          STIME    FMRI
disabled       Aug_24   svc:/platform/sun4u/sf880drd:default
online         Aug_24   svc:/milestone/single-user:default
online         Aug_24   svc:/system/utmp:default
online         Aug_24   svc:/system/system-log:default
online         Aug_24   svc:/system/system-log:default
online         Aug_24   svc:/system/rmtmpfiles:default
online         Aug_24   svc:/network/rpc/bind:default
online         Aug_24   svc:/milestone/name-services:default
online         Aug_24   svc:/system/filesystem/local:default
online         Aug_24   svc:/system/mdmonitor:default</screen>
</example>
</task>
</sect1><sect1 id="gdqyb"><title>Managing SMF Services (Task Map)</title><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><?PubTbl tgroup dispwid="5.48in"?><colspec colname="colspec3" colwidth="25*"/><colspec colname="colspec4" colwidth="40*"/><colspec colname="colspec5" colwidth="35*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Disable a service instance.</para>
</entry><entry><para>Stops a running service and prevents the service from restarting.</para>
</entry><entry><para><olink targetptr="ecdqs" remap="internal">How to Disable a Service Instance</olink></para>
</entry>
</row><row><entry><para>Enable a service instance.</para>
</entry><entry><para>Starts a service. In addition, the service will be restarted during
subsequent reboots.</para>
</entry><entry><para><olink targetptr="ecdia" remap="internal">How to Enable a Service Instance</olink></para>
</entry>
</row><row><entry><para>Restarting a service.</para>
</entry><entry><para>Stops and starts a service with one command</para>
</entry><entry><para><olink targetptr="eywvo" remap="internal">How to Restart a Service</olink></para>
</entry>
</row><row><entry><para>Restoring a service in maintenance state.</para>
</entry><entry><para>Shows how to clean up and restart a service that is in maintenance state.</para>
</entry><entry><para><olink targetptr="ecdna" remap="internal">How to Restore a Service That Is in the Maintenance
State</olink></para>
</entry>
</row><row><entry><para>Revert to a snapshot.</para>
</entry><entry><para>Uses a previous snapshot to correct problems with a service.</para>
</entry><entry><para><olink targetptr="ecdpn" remap="internal">How to Revert to Another SMF Snapshot</olink></para>
</entry>
</row><row><entry><para>Create an profile.</para>
</entry><entry><para>Create a profile to disable or enable services as needed.</para>
</entry><entry><para><olink targetptr="gdavi" remap="internal">How to Create an SMF Profile</olink></para>
</entry>
</row><row><entry><para>Apply a profile.</para>
</entry><entry><para>Uses the information in a profile to disable or enable services as needed.</para>
</entry><entry><para><olink targetptr="fgour" remap="internal">How to Apply an SMF Profile</olink></para>
</entry>
</row><row><entry><para>Change the services and their configuration using the <command>netservices</command> command.</para>
</entry><entry><para>Uses the information in the <filename>generic_limited.xml</filename> or <filename>generic_open.xml</filename> profiles to disable or enable services and make
configuration changes to those services, as well.</para>
</entry><entry><para><olink targetptr="gdavv" remap="internal">Changing Services Offered to the Network with
generic*.xml</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="eqbrs"><title>Managing SMF Services</title><para>This section includes information on managing SMF services.</para><sect2 id="fddwy"><title>Using RBAC Rights Profiles With SMF</title><itemizedlist><para>You can use RBAC rights profiles to allow users to manage some of the
SMF services, without having to give the user <literal>root</literal> access.
The rights profiles define what commands the user can run. For SMF, the following
profiles have been created:</para><listitem><para><literal>Service Management</literal>: User can add, delete
or modify services.</para>
</listitem><listitem><para><literal>Service Operator</literal>: User can request state
changes of any service instance, such as restart and refresh.</para>
</listitem>
</itemizedlist><para>For specific information about the authorizations, see the <olink targetdoc="refman" targetptr="smf-security-5" remap="external"><citerefentry><refentrytitle>smf_security</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> man page.
For instructions to assign a rights profile, see <olink targetdoc="sysadv6" targetptr="rbactask-25" remap="external"><citetitle remap="section">How to Change the RBAC Properties of a User</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para>
</sect2><task id="ecdqs"><title>How to Disable a Service Instance</title><tasksummary><para>Use the following procedure to disable a service. The service status
change is recorded in the service configuration repository. Once the service
is disabled, the disabled state will persist across reboots. The only way
to get the service running again is to enable it.</para>
</tasksummary><procedure>&rolestepA;<step><para>Check the dependents of the service you want to disable.</para><para>If this service has dependents that you need, then you cannot disable
this service.</para><screen># svcs -D FMRI</screen>
</step><step><para>Disable the service.</para><screen># svcadm disable <replaceable>FMRI</replaceable></screen>
</step>
</procedure><example id="eqbry"><title>Disabling the <command>rlogin</command> Service</title><para>The output from the first command shows that the <command>rlogin</command> service
has no dependents. The second command in this example disables the <command>rlogin</command> service. The third command shows that the state of the <command>rlogin</command> service instance is disabled.</para><screen># <userinput>svcs -D network/login:rlogin</userinput>
# <userinput>svcadm disable network/login:rlogin</userinput>
STATE          STIME    FMRI
# <userinput>svcs network/login:rlogin</userinput>
STATE          STIME    FMRI
disabled         11:17:24 svc:/network/login:rlogin</screen>
</example>
</task><task id="ecdia"><title>How to Enable a Service Instance</title><tasksummary><para>Use the following procedure to enable a service. The service status
change is recorded in the service configuration repository. Once the service
is enabled, the enabled state will persist across system reboots if the service
dependencies are met.</para>
</tasksummary><procedure>&rolestepA;<step><para>Determine whether service dependencies are satisfied.</para><para>If
the service is enabled, then the service dependencies are satisfied. If not,
use <command>svcadm enable</command> <option>r</option> FMRI to recursively
enable all dependencies.</para><screen># svcs -l FMRI|grep enabled</screen>
</step><step><para>Enable a service.</para><screen># svcadm enable <replaceable>FMRI</replaceable></screen>
</step>
</procedure><example id="eqbro"><title>Enabling the <command>rlogin</command> Service</title><para>The second command in this example enables the <command>rlogin</command> service.
The third command shows that the state of the <command>rlogin</command> service
instance is online.</para><screen># <userinput>svcs -l network/login:rlogin|grep enabled</userinput>
enabled      false
# <userinput>svcadm enable network/login:rlogin</userinput>
# <userinput>svcs network/login:rlogin</userinput>
STATE          STIME    FMRI
online         12:09:16 svc:/network/login:rlogin</screen>
</example><example id="gbaur"><title>Enabling a Service in Single-user Mode</title><para>The following command enables rpcbind. The <option>t</option> option
starts the service in temporary mode which does not change the service repository.
The repository is not writable in single-user mode. The <option>r</option> option
recursively starts all the dependencies of the named service.</para><screen># svcadm enable -rt rpc/bind</screen>
</example>
</task><task id="eywvo"><title>How to Restart a Service</title><tasksummary><para>If a service is currently running but needs to be restarted due to a
configuration change or some other reason, the service can be restarted without
you having to type separate commands to stop and start the service. The only
reason to specifically disable and then enable a service is if changes need
to be made before the service is enabled, and after the service is disabled.</para>
</tasksummary><procedure>&rolestepA;<step><para>Restart a service.</para><screen># svcadm restart <replaceable>FMRI</replaceable></screen>
</step>
</procedure>
</task><task id="ecdna"><title>How to Restore a Service That Is in the Maintenance
State</title><procedure>&rolestepA;<step><para>Determine if any process that are dependent to the service have
not stopped.</para><para>Normally, when a service instance is in a maintenance
state, all processes associated with that instance have stopped. However,
you should make sure before you proceed. The following command lists all of
the processes that are associated with a service instance as well as the PIDs
for those processes.</para><screen># svcs -p <replaceable>FMRI</replaceable></screen>
</step><step performance="optional"><para>Kill any remaining processes.</para><para>Repeat
this step for all processes that are displayed by the <command>svcs</command> command.</para><screen># pkill -9 <replaceable>PID</replaceable></screen>
</step><step><para>If necessary, repair the service configuration.</para><para>Consult
the appropriate service log files in <filename>/var/svc/log</filename> for
a list of errors.</para>
</step><step><para>Restore the service.</para><screen># svcadm clear <replaceable>FMRI</replaceable></screen>
</step>
</procedure>
</task><task id="ecdpn"><title>How to Revert to Another SMF Snapshot</title><tasksummary><para>If the service configuration is wrong, the problem can be fixed by reverting
to the last snapshot that started successfully. In this procedure, a previous
snapshot of the <literal>console-login</literal> service is used.</para>
</tasksummary><procedure>&rolestepA;<step><para>Run the <command>svccfg</command> command.</para><screen># <userinput>svccfg</userinput>
svc:&gt;</screen><substeps><step><para>Select the service instance that you want to fix.</para><note><para>You must use an FMRI that fully defines the instance. No shortcuts
are allowed.</para>
</note><screen>svc:&gt; <userinput>select system/console-login:default</userinput>
svc:/system/console-login:default&gt;</screen>
</step><step><para>Generate a list of available snapshots.</para><screen>svc:/system/console-login:default&gt; <userinput>listsnap</userinput>
initial
running
start
svc:/system/console-login:default&gt;</screen>
</step><step><para>Select to revert to the <literal>start</literal> snapshot.</para><para>The <literal>start</literal> snapshot is the last snapshot in which
the service successfully started.</para><screen>svc:/system/console-login:default&gt; <userinput>revert start</userinput>
svc:/system/console-login:default&gt;</screen>
</step><step><para>Quit <command>svccfg</command>.</para><screen>svc:/system/console-login:default&gt; <userinput>quit</userinput>
#</screen>
</step>
</substeps>
</step><step><para>Update the information in the service configuration repository.</para><para>This step updates the repository with the configuration information
from the <literal>start</literal> snapshot.</para><screen># <userinput>svcadm refresh system/console-login</userinput></screen>
</step><step><para>Restart the service instance.</para><screen># <userinput>svcadm restart system/console-login</userinput></screen>
</step>
</procedure>
</task><task id="gdavi"><title>How to Create an SMF Profile</title><tasksummary><para>A profile is an XML file which lists SMF services and whether each should
be enabled or disabled. Profiles are used to enable or disable many services
at once. Not all services need to be listed in a profile. Each profile only
needs to include those services that need to be enabled or disabled to make
the profile useful.</para>
</tasksummary><procedure><step><para>Create a profile.</para><para>In this example, the <command>svccfg</command> command
is used to create a profile which reflects which services are enabled or disabled
on the current system. Alternately, you could make a copy of an existing profile
to edit.</para><screen># <userinput>svccfg extract&gt; profile.xml</userinput></screen><para>If you are using JumpStart, if you have large numbers of identical systems,
or if you want to archive the system configuration for later restoration,
you may want to use this procedure to create a unique version of a SMF profile.</para>
</step><step performance="required"><para>Edit the <filename>profile.xml</filename> file
to make any required changes.</para><substeps><step><para>Change the name of the profile in the <literal>service_bundle</literal> declaration.</para><para>In this example the name is changed to <literal>profile</literal>.</para><screen># <userinput>cat profile.xml</userinput>
  ...
&lt;service_bundle type=`profile` name=`<userinput>profile</userinput>`
    xmIns::xi='http://www.w3.org/2003/XInclude'
  ...</screen>
</step><step><para>Remove any services that should not be managed by this profile.</para><para>For each service, remove the three lines that describe the service.
Each service description starts with <literal>&lt;service</literal> and ends
with <literal>&lt;/service</literal>. This example shows the lines for the
LDAP client service.</para><screen># <userinput>cat profile.xml</userinput>
 ...
 &lt;service name='network/ldap/client' version='1' type='service'&gt;
         &lt;instance  name='default' enabled='true'/&gt;
 &lt;/service&gt;</screen>
</step><step><para>Add any services that should be managed by this profile.</para><para>Each service needs to be defined using the three line syntax shown above.</para>
</step><step><para>If necessary, change the enabled flag for selected services.</para><para>In this example, the <command>sendmail</command> service is disabled.</para><screen># <userinput>cat profile.xml</userinput>
  ...
  &lt;service  name='network/smtp' version='1' type='service'&gt;
    &lt;instance  name='sendmail' enabled='<userinput>false</userinput>'/&gt;
  &lt;/service&gt;
  ...</screen>
</step>
</substeps>
</step><step><para>When necessary, apply the new profile.</para><para>See <olink targetptr="fgour" remap="internal">How to Apply an SMF Profile</olink> for instructions.</para>
</step>
</procedure>
</task><task id="fgour"><title>How to Apply an SMF Profile</title><procedure>&rolestepA;<step><para>Apply an profile.</para><para>In this example, the <literal>profile.xml</literal> profile is used.</para><screen># <userinput>svccfg apply profile.xml</userinput></screen><note><para>For specific instructions for switching between the <filename>generic_limited_net.xml</filename> and <filename>generic_open.xml</filename> and the properties that
need to be applied when making this switch, please see <olink targetptr="gdavv" remap="internal">Changing
Services Offered to the Network with generic*.xml</olink></para>
</note>
</step>
</procedure>
</task><task id="gdavv"><title>Changing Services Offered to the Network with <literal>generic*.xml</literal></title><tasksummary><para>The <command>netservices</command> command switches system
services between minimal network exposure and the traditional network exposure
(as in previous Solaris releases). The switch is done with the <filename>generic_limited.xml</filename> and <filename>generic_open.xml</filename> profiles. In addition,
some services properties are changed by the command to limit some services
to a local-only mode or to the traditional mode, as appropriate.</para><note><para>In the Solaris Express 7/06 release, the <filename>generic_limited_net</filename> profile and the local-mode only service properties are applied by default.</para>
</note>
</tasksummary><procedure>&rolestepA;<step><para>Run the <command>netservices</command> command.</para><para>In
this example, the open or traditional network exposure is selected.</para><screen># <userinput>/usr/sbin/netservices open</userinput></screen>
</step>
</procedure><example id="gdawj"><title>Limiting Network Service Exposure</title><para>This command changes properties to run some services in local mode,
as well as restricts which services are enabled with the <filename>generic_limited_net</filename> profile. The command should only be used if the <filename>generic_open.xml</filename> profile had been applied.</para><screen># <userinput>/usr/sbin/netservices limited</userinput></screen>
</example>
</task>
</sect1><sect1 id="eqbwh"><title>Configuring SMF Services</title><task id="ecdhr"><title>How to Modify a Service</title><tasksummary><para>The following procedure shows how to change the configuration of a service
that is not managed by the <command>inetd</command> service.</para>
</tasksummary><procedure>&rolestepA;<step><para>Make changes to the configuration files, as needed.</para><para>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.</para>
</step><step><para>Restart the service.</para><screen># svcadm restart <replaceable>FMRI</replaceable></screen>
</step>
</procedure><example id="eupsa"><title>Sharing an NFS File System</title><para>To share a file system using the NFS service, you must define the file
system in the <filename>/etc/dfs/dfstab</filename> file and then restart the
NFS service. This example shows you what the <filename>dfstab</filename> file
could look like, as well as how to restart the service.</para><screen># <userinput>cat /etc/dfs/dfstab</userinput>
 .
 .
share -F nfs -o rw /export/home
# <userinput>svcadm restart svc:/network/nfs/server</userinput></screen>
</example>
</task><task id="fgoxy"><title>How to Change an Environment Variable for a Service</title><tasksummary><para>This procedure shows how to modify <command>cron</command> environment
variables to help with debugging.</para>
</tasksummary><procedure>&rolestepA;<step><para>Verify that the service is running.</para><screen># <userinput>svcs system/cron</userinput>
STATE          STIME    FMRI
online         Dec_04   svc:/system/cron:default</screen>
</step><step><para>Set environment variables.</para><para>In this example the <literal>UMEM_DEBUG</literal> and <literal>LD_PRELOAD</literal> environment variables are set.
For information about the <literal>setenv</literal> subcommand refer to the <olink targetdoc="refman" targetptr="svccfg-1m" remap="external"><citerefentry><refentrytitle>svccfg</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para><screen># <userinput>svccfg -s system/cron:default setenv UMEM_DEBUG default</userinput>
# <userinput>svccfg -s system/cron:default setenv LD_PRELOAD libumem.so</userinput></screen>
</step><step><para>Refresh and restart the service.</para><screen># <userinput>svcadm refresh system/cron</userinput>
# <userinput>svcadm restart system/cron</userinput></screen>
</step><step><para>Verify that the change has been made.</para><screen># <userinput>pargs -e `pgrep -f /usr/sbin/cron`</userinput>
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
#</screen>
</step>
</procedure>
</task><task id="euprm"><title>How to Change a Property for an <command>inetd</command> Controlled
Service</title><procedure>&rolestepA;<step><para>List the properties for the specific service.</para><para>This
command displays all of the properties for the service identified by the FMRI.</para><screen># inetadm -l <replaceable>FMRI</replaceable></screen>
</step><step><para>Change the property for the service.</para><para>Each property
for an <command>inetd</command> 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.</para><screen># inetadm -m <replaceable>FMRI</replaceable> <replaceable>property-name=value</replaceable></screen>
</step><step><para>Verify that the property has changed.</para><para>List the properties
again to make sure that the appropriate change has occurred.</para><screen># inetadm -l <replaceable>FMRI</replaceable></screen>
</step><step><para>Confirm that the change has taken effect.</para><para>Confirm
the property change that the change has the desired effect.</para>
</step>
</procedure><example id="eupro"><title>Changing the <literal>tcp_trace</literal> Property for <command>telnet</command></title><para>The following example shows how to set the <literal>tcp_trace</literal> property
for <command>telnet</command> to <literal>true</literal>. Checking the <command>syslog</command> output after running a <command>telnet</command> command shows
that the change has taken effect.</para><screen># <userinput>inetadm -l svc:/network/telnet:default</userinput>
SCOPE    NAME=VALUE
         name="telnet"
 .
 .
default  inherit_env=TRUE
<userinput>default  tcp_trace=FALSE</userinput>
default  tcp_wrappers=FALSE
# <userinput>inetadm -m svc:/network/telnet:default tcp_trace=TRUE</userinput>
# <userinput>inetadm -l svc:/network/telnet:default</userinput>
SCOPE    NAME=VALUE
         name="telnet"
 .
 .
default  inherit_env=TRUE
         <userinput>tcp_trace=TRUE</userinput>
default  tcp_wrappers=FALSE
# <userinput>telnet localhost</userinput>
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
login: <userinput>root</userinput>
Password: 
Last login: Mon Jun 21 05:55:45 on console
Sun Microsystems Inc.   SunOS 5.10      s10_57  May 2004
# <userinput>^D</userinput>
Connection to localhost closed by foreign host.
# <userinput>tail -1 /var/adm/messages</userinput>
Jun 21 06:04:57 yellow-19 inetd[100308]: [ID 317013 daemon.notice] telnet[100625]
    from 127.0.0.1 32802</screen>
</example>
</task><task id="eupri"><title>How to Modify a Command-Line Argument for an <command>inetd</command> Controlled Service</title><procedure>&rolestepA;<step><para>List the <literal>exec</literal> property for the specific service.</para><para>This command displays all the properties for the service identified
by the FMRI. Adding the <command>grep</command> command restricts the output
to the <literal>exec</literal> property for the service.</para><screen># inetadm -l <replaceable>FMRI</replaceable>|grep exec</screen>
</step><step><para>Change the <literal>exec</literal> property for the service.</para><para>The <replaceable>command-syntax</replaceable> set with the <literal>exec</literal> property
defines the command string that is run when the service is started.</para><screen># inetadm -m <replaceable>FMRI</replaceable> exec="<replaceable>command-syntax</replaceable>"</screen>
</step><step><para>Verify that the property has changed.</para><para>List the properties
again to make sure that the appropriate change has occurred.</para><screen># inetadm -l <replaceable>FMRI</replaceable></screen>
</step>
</procedure><example id="euprk"><title>Adding the Connection Logging (<option>l</option>) Option to the <command>ftp</command> Command</title><para>In this example, the <option>l</option> option is added to the <command>ftp</command> daemon when it is started. The effect of this change can be seen
by reviewing the <command>syslog</command> output after a <command>ftp</command> login
session has been completed.</para><screen># <userinput>inetadm -l svc:/network/ftp:default | grep exec</userinput>
        exec="/usr/sbin/in.ftpd -a"
# <userinput>inetadm -m svc:/network/ftp:default exec="/usr/sbin/in.ftpd -a -l"</userinput>
# <userinput>inetadm -l svc:/network/ftp:default</userinput>
SCOPE    NAME=VALUE
         name="ftp"
         endpoint_type="stream"
         proto="tcp6"
         isrpc=FALSE
         wait=FALSE
         <userinput>exec="/usr/sbin/in.ftpd -a -l"</userinput>
 .
 .
# <userinput>ftp localhost</userinput>
Connected to localhost.
220 yellow-19 FTP server ready.
Name (localhost:root): <userinput>mylogin</userinput>
331 Password required for mylogin.
Password:
230 User mylogin logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp&gt; <userinput>quit</userinput>
221-You have transferred 0 bytes in 0 files.
221-Total traffic for this session was 236 bytes in 0 transfers.
221-Thank you for using the FTP service on yellow-19.
221 Goodbye.
# <userinput>tail -2 /var/adm/message</userinput>s
Jun 21 06:54:33 yellow-19 ftpd[100773]: [ID 124999 daemon.info] FTP LOGIN FROM localhost 
     [127.0.0.1], mylogin
Jun 21 06:54:38 yellow-19 ftpd[100773]: [ID 528697 daemon.info] FTP session closed</screen>
</example>
</task><task id="epubw"><title>How to Convert <filename>inetd.conf</filename> Entries</title><tasksummary><para>The following procedure converts <filename>inetd.conf</filename> entries
into SMF service manifests. This procedure needs to be run anytime a third-party
application that depends on <command>inetd</command> is added to a system.
Also run this procedure, if you need to make configuration changes to the
entry in <command>/etc/inetd.conf</command>.</para>
</tasksummary><procedure>&rolestepA;<step><para>Convert the <filename>inetd.conf</filename> entries.</para><para>The <command>inetconv</command> command converts each entry in the selected file into service
manifests.</para><screen># inetconv -i <replaceable>filename</replaceable></screen>
</step>
</procedure><example id="epuby"><title>Converting <filename>/etc/inet/inetd.conf</filename> Entries into SMF
Service Manifests</title><screen># <userinput>inetconv -i /etc/inet/inetd.conf</userinput></screen>
</example>
</task>
</sect1><sect1 id="etesg"><title>Using Run Control Scripts (Task Map)</title><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><?PubTbl tgroup dispwid="5.48in"?><colspec colname="colspec3" colwidth="25*"/><colspec colname="colspec4" colwidth="40*"/><colspec colname="colspec5" colwidth="35*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Stop or start a service.</para>
</entry><entry><para>Use a run control script to stop or start a service.</para>
</entry><entry><para><olink targetptr="hbrunlevels-36110" remap="internal">How to Use a Run Control Script
to Stop or Start a Legacy Service</olink></para>
</entry>
</row><row><entry><para> Add a run control script.</para>
</entry><entry><para>Create a run control script and add it to the <filename>/etc/init.d</filename> directory.</para>
</entry><entry><para><olink targetptr="hbrunlevels-14344" remap="internal">How to Add a Run Control Script</olink></para>
</entry>
</row><row><entry><para>Disable a run control script.</para>
</entry><entry><para>Disable a run control script by renaming the file.</para>
</entry><entry><para><olink targetptr="hbrunlevels-35982" remap="internal">How to Disable a Run Control Script</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="fahqr"><title>Using Run Control Scripts</title><task id="hbrunlevels-36110"><title>How to Use a Run Control Script to Stop
or Start a Legacy Service</title><tasksummary><para>One advantage of having individual scripts for each run level is that
you can run scripts in the <filename>/etc/init.d</filename> directory individually
to stop system services without changing a system's run level.</para>
</tasksummary><procedure>&rolestepA;<step id="hbrunlevels-step-7"><para>Stop the system service. </para><screen># <userinput>/etc/init.d/</userinput><replaceable>filename</replaceable> <userinput>stop</userinput></screen>
</step><step id="hbrunlevels-step-8"><para>Restart the system service.</para><screen># <userinput>/etc/init.d/</userinput><replaceable>filename</replaceable> <userinput>start</userinput></screen>
</step><step id="hbrunlevels-step-24"><para><indexterm id="hbrunlevels-ix954"><primary>run control scripts</primary><secondary>starting and stopping services</secondary></indexterm><indexterm id="hbrunlevels-ix955"><primary>starting and stopping services</primary></indexterm>Verify that the service has been stopped or
started.</para><screen># <userinput>pgrep -f</userinput> <replaceable>service</replaceable></screen>
</step>
</procedure><example><title>Using a Run Control Script to Stop or Start a Service</title><para>For example, you can stop the NFS server daemons by typing the following:</para><screen># <userinput>/etc/init.d/nfs.server stop</userinput>
# <userinput>pgrep -f nfs</userinput></screen><para>Then, you can restart the NFS server daemons by typing the following:</para><screen># <userinput>/etc/init.d/nfs.server start</userinput>
# <userinput>pgrep -f nfs</userinput>
101773
101750
102053
101748
101793
102114
# <userinput>pgrep -f nfs -d, | xargs ps -fp</userinput>
     UID    PID   PPID   C    STIME TTY         TIME CMD
  daemon 101748      1   0   Sep 01 ?           0:06 /usr/lib/nfs/nfsmapid
  daemon 101750      1   0   Sep 01 ?          26:27 /usr/lib/nfs/lockd
  daemon 101773      1   0   Sep 01 ?           5:27 /usr/lib/nfs/statd
    root 101793      1   0   Sep 01 ?          19:42 /usr/lib/nfs/mountd
  daemon 102053      1   0   Sep 01 ?        2270:37 /usr/lib/nfs/nfsd
  daemon 102114      1   0   Sep 01 ?           0:35 /usr/lib/nfs/nfs4cbd</screen>
</example>
</task><task id="hbrunlevels-14344"><title>How to Add a Run Control Script</title><tasksummary><para>If you want to add a run control script to start and stop a service,
copy the script into the <filename>/etc/init.d</filename> directory. Then,
create links in the <filename>rc</filename><replaceable>n</replaceable><filename>.d</filename> directory where you want the service to start and stop.</para><para>See the <filename>README</filename> file in each <filename>/etc/rc</filename><replaceable>n</replaceable><filename>.d</filename> directory for more information on naming
run control scripts. The following procedure describes how to add a run control
script.</para>
</tasksummary><procedure>&rolestepA;<step id="hbrunlevels-step-14"><para><indexterm id="hbrunlevels-ix958"><primary sortas="etc/init.d"><filename>/etc/init.d</filename> directory</primary></indexterm><indexterm><primary>run control scripts</primary><secondary>adding (how to)</secondary></indexterm><indexterm><primary>adding</primary><secondary>run control script (how to)</secondary></indexterm>Add the script to the <filename>/etc/init.d</filename> directory. </para><screen># <userinput>cp</userinput> <replaceable>filename</replaceable> <userinput>/etc/init.d</userinput>
# <userinput>chmod 0744 /etc/init.d/</userinput><replaceable>filename</replaceable>
# <userinput>chown root:sys /etc/init.d/</userinput><replaceable>filename</replaceable></screen>
</step><step id="hbrunlevels-step-15"><para>Create links to the appropriate <filename>rc</filename><replaceable>n</replaceable><filename>.d</filename> directory.</para><screen># <userinput>cd /etc/init.d</userinput>
# <userinput>ln</userinput> <replaceable>filename</replaceable> <userinput>/etc/rc2.d/</userinput><replaceable>Snnfilename</replaceable>
# <userinput>ln</userinput> <replaceable>filename</replaceable> <userinput>/etc/rc</userinput><replaceable>n</replaceable><userinput>.d/</userinput><replaceable>Knnfilename</replaceable></screen>
</step><step id="hbrunlevels-step-25"><para>Verify that the script has links in the
specified directories.</para><screen># <userinput>ls /etc/init.d/*<replaceable>filename</replaceable></userinput> <userinput>/etc/rc2.d/*<replaceable>filename</replaceable></userinput> <userinput>/etc/rc</userinput><replaceable>n</replaceable><userinput>.d/*<replaceable>filename</replaceable></userinput></screen>
</step>
</procedure><example><title>Adding a Run Control Script</title><para>The following example shows how to add a run control script for the <literal>xyz</literal> service.</para><screen># <userinput>cp xyz /etc/init.d</userinput>
# <userinput>chmod 0744 /etc/init.d/xyz</userinput>
# <userinput>chown root:sys /etc/init.d/xyz</userinput>
# <userinput>cd /etc/init.d</userinput>
# <userinput>ln xyz /etc/rc2.d/S99xyz</userinput>
# <userinput>ln xyz /etc/rc0.d/K99xyz</userinput>
# <userinput>ls /etc/init.d/*xyz /etc/rc2.d/*xyz /etc/rc0.d/*xyz</userinput></screen>
</example>
</task><task id="hbrunlevels-35982"><title>How to Disable a Run Control Script</title><tasksummary><para>You can disable a run control script by renaming it with an underscore
(<filename>_</filename>) at the beginning of the file name. Files that begin
with an underscore or dot are not executed. If you copy a file by adding a
suffix to it, both files will be run.</para>
</tasksummary><procedure>&rolestepA;<step id="hbrunlevels-step-21"><para>Rename the script by adding an underscore
(<filename>_</filename>) to the beginning of the new file.</para><screen># <userinput>cd /etc/rc</userinput><replaceable>n</replaceable><userinput>.d</userinput>
# <userinput>mv</userinput> <replaceable>filename _filename</replaceable></screen>
</step><step id="hbrunlevels-step-26"><para><indexterm id="hbrunlevels-ix960"><primary>run control scripts</primary><secondary>disabling (how to)</secondary></indexterm><indexterm id="hbrunlevels-ix959"><primary>disabling</primary><secondary>run control script (how to)</secondary></indexterm>Verify that the script has been renamed.</para><screen># <userinput>ls _*</userinput>
<replaceable>_filename</replaceable></screen>
</step>
</procedure><example><title>Disabling a Run Control Script</title><para>The following example shows how to rename the <filename>S99datainit</filename> script.</para><screen># <userinput>cd /etc/rc2.d</userinput>
# <userinput>mv S99datainit _S99datainit</userinput>
# <userinput>ls _*</userinput>
_S99datainit</screen>
</example>
</task>
</sect1><sect1 id="ecdps"><title>Troubleshooting the Service Management Facility</title><task id="ecdwg"><title>Debugging a Service That Is Not Starting</title><tasksummary><para>In this procedure, the print service is disabled.</para>
</tasksummary><procedure>&rolestepA;<step><para>Request information about the hung service.</para><screen># <userinput>svcs -xv</userinput>
svc:/application/print/server:default (LP Print Service)
 State: disabled since Wed 13 Oct 2004 02:20:37 PM PDT
Reason: Disabled by an administrator.
   See: http://sun.com/msg/SMF-8000-05
   See: man -M /usr/share/man -s 1M lpsched
Impact: 2 services are not running:
        svc:/application/print/rfc1179:default
        svc:/application/print/ipp-listener:default</screen><para>The <option>x</option> option provides additional information about
the service instances that are impacted.</para>
</step><step><para>Enable the service.</para><screen># <userinput>svcadm enable application/print/server</userinput></screen>
</step>
</procedure>
</task><task id="ecduh"><title>How to Repair a Corrupt Repository</title><tasksummary><itemizedlist><para>This procedure shows how to replace a corrupt repository with a default
copy of the repository. When the repository daemon, <command>svc.configd</command>,
is started, it does an integrity check of the configuration repository. This
repository is stored in <filename>/etc/svc/repository.db</filename>. The repository
can become corrupted due to one of the following reasons:</para><listitem><para>Disk failure</para>
</listitem><listitem><para>Hardware bug</para>
</listitem><listitem><para>Software bug</para>
</listitem><listitem><para>Accidental overwrite of the file</para>
</listitem>
</itemizedlist><para>If the integrity check fails, the <command>svc.configd</command> daemon
writes a message to the console similar to the following:</para><screen>svc.configd: smf(5) database integrity check of:

    /etc/svc/repository.db

  failed.  The database might be damaged or a media error might have
  prevented it from being verified.  Additional information useful to
  your service provider is in:

    /etc/svc/volatile/db_errors

  The system will not be able to boot until you have restored a working
  database.  svc.startd(1M) will provide a sulogin(1M) prompt for recovery
  purposes.  The command:

    /lib/svc/bin/restore_repository

  can be run to restore a backup version of your repository. See
  http://sun.com/msg/SMF-8000-MY for more information.</screen><para>The <command>svc.startd</command> daemon then exits and starts <command>sulogin</command> to enable you to perform maintenance.</para>
</tasksummary><procedure><step><para>Enter the <literal>root</literal> password at the <command>sulogin</command> prompt. <command>sulogin</command> enables the <literal>root</literal> user to enter system
maintenance mode to repair the system.</para>
</step><step><para>Run the following command:</para><screen># <userinput>/lib/svc/bin/restore_repository</userinput></screen><para>Running this command takes you through the necessary steps to restore
a non-corrupt backup. SMF automatically takes backups of the repository at
key system moments. For more information see <olink targetptr="frjjz" remap="internal">SMF
Repository Backups</olink>.</para><para>When started, the <command>/lib/svc/bin/restore_repository</command> command displays a message similar to the following:</para><screen>Repository Restore utility
See http://sun.com/msg/SMF-8000-MY for more information on the use of
this script to restore backup copies of the smf(5) repository.

If there are any problems which need human intervention, this script
will give instructions and then exit back to your shell.

Note that upon full completion of this script, the system will be
rebooted using reboot(1M), which will interrupt any active services.</screen><para>If the system that you are recovering is not a local zone, the script
explains how to remount the <filename>/</filename> and <filename>/usr</filename> file
systems with read and write permissions to recover the databases. The script
exits after printing these instructions. Follow the instructions, paying special
attention to any errors that might occur.</para><para>After the <literal>root</literal> (<filename>/</filename>) file system is mounted with write permissions, or if the system
is a local zone, you are prompted to select the repository backup to restore:</para><screen>The following backups of /etc/svc/repository.db exists, from
oldest to newest:

... <replaceable>list of backups</replaceable> ...</screen><para>Backups are given names, based on type and the time the backup was taken.
Backups beginning with <literal>boot</literal> are completed before the first
change is made to the repository after system boot.  Backups beginning with <literal>manifest_import</literal> are completed after <filename>svc:/system/manifest-import:default</filename> finishes its process. The time of the backup is given in <replaceable>YYYYMMDD_HHMMSS</replaceable> format.</para>
</step><step><para>Enter the appropriate response.</para><para>Typically, the most
recent backup option is selected.</para><programlisting>Please enter one of:
        1) boot, for the most recent post-boot backup
        2) manifest_import, for the most recent manifest_import backup.
        3) a specific backup repository from the above list
        4) -seed-, the initial starting repository. (All customizations
           will be lost.)
        5) -quit-, to cancel.

Enter response [boot]:</programlisting><para>If you press Enter without specifying a backup to restore, the default
response, enclosed in <literal>[]</literal>  is selected. Selecting <command>-quit-</command> exits the <command>restore_repository</command> script, returning
	you to your shell prompt.</para><note><para>Selecting <command>-seed-</command> restores the <filename>seed</filename> repository.
This repository is designed for use during initial installation and upgrades.
Using the <filename>seed</filename> repository for recovery purposes should
be a last resort.</para>
</note><para>After the backup to restore has been selected, it is validated and its
integrity is checked. If there are any problems, the <command>restore_repository</command> command
prints error messages and prompts you for another selection. Once a valid
backup is selected, the following information is printed, and you are prompted
for final confirmation.</para><programlisting>After confirmation, the following steps will be taken:

svc.startd(1M) and svc.configd(1M) will be quiesced, if running.
/etc/svc/repository.db
    -- renamed --&gt; /etc/svc/repository.db_old_YYYYMMDD_HHMMSS
/etc/svc/volatile/db_errors
    -- copied --&gt; /etc/svc/repository.db_old_YYYYMMDD_HHMMSS_errors
repository_to_restore
    -- copied --&gt; /etc/svc/repository.db
and the system will be rebooted with reboot(1M).

Proceed [yes/no]?</programlisting>
</step><step><para>Type <command>yes</command> to remedy the fault.</para><para>The
system reboots after the <command>restore_repository</command> command executes
all of the listed actions.</para>
</step>
</procedure>
</task><task id="ecdwu"><title>How to Boot Without Starting Any Services</title><tasksummary><para>If problems with starting services occur, sometimes a system will hang
during the boot. This procedure shows how to troubleshoot this problem.</para>
</tasksummary><procedure><step><para>Boot without starting any services.</para><para>This command instructs
the <command>svc.startd</command> daemon to temporarily disable all services
and start <command>sulogin</command> on the console.</para><screen>ok <userinput>boot -m milestone=none</userinput></screen>
</step><step><para>Log in to the system as <literal>root</literal>.</para>
</step><step><para>Enable all services.</para><screen># <userinput>svcadm milestone all</userinput></screen>
</step><step><para>Determine where the boot process is hanging.</para><para>When
the boot process hangs, determine which services are not running by running <command>svcs</command> <option>a</option>. Look for error messages in the log files
in <filename>/var/svc/log</filename>.</para>
</step><step><para>After fixing the problems, verify that all services have started.</para><substeps><step><para>Verify that all needed services are online.</para><screen># <userinput>svcs -x</userinput></screen>
</step><step><para>Verify that the <literal>console-login</literal> service dependencies
are satisfied.</para><para>This command verifies that the <command>login</command> process
on the console will run.</para><screen># <userinput>svcs -l system/console-login:default</userinput></screen>
</step>
</substeps>
</step><step><para>Continue the normal booting process.</para>
</step>
</procedure>
</task><task id="gcvri"><title>How to Force a <command>sulogin</command> Prompt If
the <literal>system/filesystem/local:default</literal> Service Fails During
Boot</title><tasksummary><para>Local file systems that are not required to boot the Solaris OS are
mounted by the <literal>svc:/system/filesystem/local:default</literal> service.
When any of those file systems are unable to be mounted, the service enters
a maintenance state. System startup continues, and any services which do not
depend on <literal>filesystem/local</literal> are started. Services which
require <literal>filesystem/local</literal> to be online before starting through
dependencies are not started.</para><para>To change the configuration of the system so that a <command>sulogin</command> prompt
appears immediately after the service fails instead of allowing system startup
to continue, follow the procedure below.</para>
</tasksummary><procedure><step><para>Modify the <literal>system/console-login</literal> service.</para><screen># <userinput>svccfg -s svc:/system/console-login</userinput>
svc:/system/console-login&gt; <userinput>addpg site,filesystem-local dependency</userinput>
svc:/system/console-login&gt; <userinput>setprop site,filesystem-local/entities = fmri: svc:/system/filesystem/local</userinput>
svc:/system/console-login&gt; <userinput>setprop site,filesystem-local/grouping = astring: require_all</userinput>
svc:/system/console-login&gt; <userinput>setprop site,filesystem-local/restart_on = astring: none</userinput>
svc:/system/console-login&gt; <userinput>setprop site,filesystem-local/type = astring: service</userinput>
svc:/system/console-login&gt; <userinput>end</userinput></screen>
</step><step><para>Refresh the service.</para><screen># <userinput>svcadm refresh console-login</userinput></screen>
</step>
</procedure><example id="gcvxr"><title>Forcing an <command>sulogin</command> Prompt Using Jumpstart</title><para>Save the following commands into a script and save it as <filename>/etc/rcS.d/S01site-customfs</filename>.</para><screen>#!/bin/sh
#
# This script adds a dependency from console-login -&gt; filesystem/local
# This forces the system to stop the boot process and drop to an sulogin prompt
# if any file system in filesystem/local fails to mount.

PATH=/usr/sbin:/usr/bin
export PATH

	svccfg -s svc:/system/console-login &lt;&lt; EOF
addpg site,filesystem-local dependency
setprop site,filesystem-local/entities = fmri: svc:/system/filesystem/local
setprop site,filesystem-local/grouping = astring: require_all
setprop site,filesystem-local/restart_on = astring: none
setprop site,filesystem-local/type = astring: service
EOF

svcadm refresh svc:/system/console-login

[ -f /etc/rcS.d/S01site-customfs ] &amp;&amp;
    rm -f /etc/rcS.d/S01site-customfs</screen>
</example><taskrelated role="troubleshooting"><para>When a failure occurs with the <literal>system/filesystem/local:default</literal> service,
the <command>svcs</command> <option>vx</option> command should be used to
identify the failure. After the failure has been fixed, the following command
clears the error state and allows the system boot to continue: <command>svcadm</command> <option role="nodash">clear filesystem/local</option>.</para>
</taskrelated>
</task>
</sect1>
</chapter><?Pub *0000058102 0?>