Go to main content

Managing System Services in Oracle® Solaris 11.4

Exit Print View

Updated: Febuary 2019
 
 

Configuration Files and SMF Services

SMF is the recommended mechanism to use to start applications. In most cases, SMF replaces the use of configuration files for managing services. This section describes how some common legacy configuration scripts and files are handled.

/etc/rc?.d scripts

The /etc/rc?.d directories, where ? represents a run level, contain legacy initialization and termination scripts for managing services that execute on run level transitions. Most services that were formerly implemented by /etc/rc?.d scripts are managed by SMF. Some /etc/rc?.d scripts are retained to enable you to use third-party applications that expect these services as /etc/rc*.d scripts. These scripts are hard linked to files in the /etc/init.d directory. For information about /etc/rc?.d scripts and about run levels, see the /etc/init.d/README file, the README files in the /etc/rc?.d directories, and the inittab(5) man page. For instructions to convert a run control script, see How to Convert a Run Control Script to an SMF Service in Developing System Services in Oracle Solaris 11.4. After you convert an rc?d script, rename the script from Sscript to sscript to effectively remove the script.

/etc/init.d scripts

The /etc/init.d directory contains initialization and termination scripts for changing init states. Some of these scripts are hard linked to scripts in the /etc/rc?.d directories. For information about /etc/init.d scripts, see /etc/init.d/README and the init.d(5) man page.

Legacy init.d run control scripts are represented with SMF FMRIs that begin with lrc instead of svc. For example, the /etc/rc2.d/S47pppd PPP configuration script is represented by the lrc:/etc/rc2_d/S47pppd service. The state of these lrc services is legacy_run. As shown in the following example, you can list names and start times of legacy services, but you cannot administer these services by using SMF.

$ svcs lrc:\*
STATE          STIME     FMRI
legacy_run      9:34:54  lrc:/etc/rc2_d/S47pppd
legacy_run      9:34:54  lrc:/etc/rc2_d/S89PRESERVE
$ svcs -l lrc:/etc/rc2_d/S47pppd
svcs: Operation not supported for legacy service 'lrc:/etc/rc2_d/S47pppd'
$ svccfg -s lrc:/etc/rc2_d/S47pppd listprop
svccfg: Operation not supported for legacy service 'lrc:/etc/rc2_d/S47pppd'
/etc/inittab entries

Entries in the /etc/inittab file control process dispatching by init. Do not edit the /etc/inittab file directly. Instead, modify SMF services. See How to Modify a ttymon Property Value for an example of how to modify a parameter passed to ttymon.

For information about the format of /etc/inittab file entries, see the inittab(5) man page. For information about run levels, see the inittab(5) man page and /etc/init.d/README.

/etc/inetd.conf file

Services that were formerly configured by using the inetd.conf file are now configured by using SMF. Configurations in the inetd.conf file must be converted to SMF services to be available for use. See Converting inetd Services to SMF Services. For inetd services that are already converted to SMF services, see Modifying Services that are Controlled by inetd.

/etc/nscd.conf file
/etc/nsswitch.conf file
/etc/resolv.conf file

Do not edit these files. Edits will be lost. These files are automatically generated from SMF data for backward compatibility with applications that might parse the file. Use the svccfg setprop command to modify property values as shown in Setting Property Values.

The function of the nscd.conf file is replaced by the svc:/system/name-service-cache SMF service. See the nscd.conf(5) man page to see which name-service-cache properties to configure instead of editing the nscd.conf file.

The function of the nsswitch.conf file is replaced by the svc:/system/name-service/switch SMF service. See the nsswitch.conf(5) man page to see which name-service/switch properties to configure instead of editing the nsswitch.conf file.

The function of the resolv.conf file is replaced by the svc:/network/dns/client SMF service. See the resolv.conf(5) man page to see which dns/client properties to configure instead of editing the resolv.conf file.

These files are examples of configuration files that you should not edit. Other such files exist. In a few cases, editing a configuration file is the correct way to modify configuration, as described in Modifying Services that are Configured by a File. Before editing any configuration file, read any comments in the file and any associated man page to ensure that editing the file is the correct way to modify the configuration for the related service.