Go to main content

Administering TCP/IP Networks, IPMP, and IP Tunnels in Oracle® Solaris 11.3

Exit Print View

Updated: March 2019

Adding inetd Based Services That Run Over Transport Layer Protocols

In Oracle Solaris, several transport layer protocols, for example, SCTP, TCP, and UDP, provide services to application layer protocols. By default, these protocols typically do not require any additional configuration. However, you might need to explicitly configure certain application layer services to use certain network protocols. Some examples include the echo and discard applications.

How to Add an inetd Based Service That Runs Over a Transport Layer Protocol

The following procedure describes the basic steps for adding inet services (those controlled by the inetd daemon) for a transport layer protocol to the SMF repository. For more information about modifying services that are controlled by inetd, see Modifying Services that are Controlled by inetd in Managing System Services in Oracle Solaris 11.3.

For example purposes only, the procedure describes how to add a new SCTP echo service by using the manifest echo.xml (/lib/svc/manifest/network/echo.xml). However, you can use the same basic procedure to add different services that run over other transport layer protocols, for example, TCP and UDP.

Before You Begin

Prior to performing this procedure, confirm that the service you want to add is controlled by the inetd daemon. For example, the output of the following command shows that the echo service, which is used in this procedure's examples, is controlled by inetd:

$ inetadm
disabled disabled        svc:/network/echo:dgram
disabled disabled        svc:/network/echo:stream
  1. Log in to the local system with a user account that has write privileges for system files.
  2. Add a definition for the new service instance to the /etc/services file by using the pfedit command.

    See the pfedit(1M) man page.

    Use the following syntax for the service definition:

    service-name port/protocol aliases
  3. Determine the location of the manifest for the specified service.
    $ svcs -l service-name

    For example, you would locate the manifest for the echo service as follows:

    $ svcs -l echo
    fmri         svc:/network/echo:stream
    name         echo
    enabled      false
    state        disabled
    next_state   none
    state_time   Thu Dec  3 08:11:11 2015
    restarter    svc:/network/inetd:default
    manifest     /etc/svc/profile/generic.xml
    manifest     /lib/svc/manifest/network/echo.xml
    fmri         svc:/network/echo:dgram
    name         echo
    enabled      false
    state        disabled
    next_state   none
    state_time   Thu Dec  3 08:11:10 2015
    restarter    svc:/network/inetd:default
    manifest     /etc/svc/profile/generic.xml
    manifest     /lib/svc/manifest/network/echo.xml
  4. Using a text editor, modify the existing service manifest to add a new instance with the appropriate property values.

    For example, /lib/svc/manifest/network/echo.xml is where the echo service manifest is located.

    1. Change to the directory where the service manifest is stored.
      # cd /lib/svc/manifest/network
    2. Copy and paste an existing service instance element.

      For this particular example, you could use either the dgram or stream element.

    3. Provide a different name for the service instance element (sctp_stream is used in this example), then change the property value as appropriate.

    In this example, the value of the proto property is changed to sctp.

  5. Edit the /etc/svc/profile/generic.xml profile file to add the new service instance.

    For example, you would add a new sctp_stream instance as follows:

    <service name='network/echo' version='1' type='service'>
    <instance name='stream' enabled='false'/>
    <instance name='dgram' enabled='false'/>
    <instance name='sctp_stream' enabled='false'/>
  6. Restart the manifest-import service.
    $ svcadm restart manifest-import
  7. Verify that the new service instance has been added.
    $ svcs FMRI

    For the FMRI argument, use the Fault Managed Resource Identifier (FMRI) of the service manifest for example, the echo service's FMRI:

    $ svcs echo

    Or, you can use the inetadm command the display similar information:

    $ inetadm -l echo
  8. Verify that the property values for the new instance (for example, echo:sctp_stream) are correct.
    $ inetadm -l echo:sctp_stream
             exec="/usr/lib/inet/in.echod -s"
    default  bind_addr=""
    default  bind_fail_max=-1
    default  bind_fail_interval=-1
    default  max_con_rate=-1
    default  max_copies=-1
    default  con_rate_offline=-1
    default  failrate_cnt=40
    default  failrate_interval=60
    default  inherit_env=TRUE
    default  tcp_trace=FALSE
    default  tcp_wrappers=FALSE
    default  connection_backlog=10
    default  tcp_keepalive=FALSE 
  9. (Optional) Enable the new service instance.
    # inetadm -e FMRI

    For example, you would enable the echo service as follows:

    $ inetadm -e svc:/network/echo:sctp_stream
    $ svcs echo

    Or, use the inetadm command as follows:

    $ inetadm | grep echo