INETD(8) | Maintenance Commands and Procedures | INETD(8) |
inetd - Service Management Facility delegated restarter for inet services
inetd [configuration-file] start | stop | refresh
svc:/network/inetd:default
inetd is the delegated restarter for internet services for the Service Management Facility (SMF). Its basic responsibilities are to manage service states in response to administrative requests, system failures, and service failures; and, when appropriate, to listen for network requests for services.
Services are no longer managed by editing the inetd configuration file, inetd.conf(5). Instead, you use inetconv(8) to convert the configuration file content into SMF format services, then manage these services using inetadm(8) and svcadm(8). Once a service has been converted by inetconv, any changes to the legacy data in the inetd config file will not become effective. However, inetd does alert the administrator when it notices change in the configuration file. See the start description under the "inetd Methods" section for further information.
Also note that the current inetd cannot be run from outside the SMF. This means it cannot be run from the command line, as was supported by the previous inetd. If you attempt to do this, a message is sent to stderr displaying mappings between the options supported by the previous inetd to the SMF version of inetd.
inetd listens for connections on behalf of all services that are in either the online or degraded state. A service enters one of these states when the service is enabled by the user and inetd manages to listen on its behalf. A listen attempt can fail if another server (whether standalone or a third-party internet service) is already listening on the same port. When this occurs, inetd logs this condition and continues trying to bind to the port at configured intervals a configured number of times. See the property bind_fail_max under "Service Properties," below, for more details.
The configuration of all inetd's managed SMF services is read when it is started. It is reread when inetd is refreshed, which occurs in response to an SMF request, or when it receives a SIGHUP signal. See the refresh description under "inetd Methods" for the behavior on configuration refresh.
You can use the inetadm(8) or svccfg(8) utilities to make configuration changes to Internet services within the SMF repository. inetadm has the advantage over svccfg in that it provides an Internet/RPC service context.
As part of its service management duties, inetd implements a state machine for each of its managed services. The states in this machine are made up of the smf(7) set of states. The semantics of these states are as follows:
uninitialized
online
degraded
offline
disabled
maintenance
Events constituting malfunctioning include: inetd's inability to listen on behalf on any of the service's protocols before exceeding the service's bind retry limit, non-start methods returning with non-success return values, and the service exceeding its failure rate.
You request the maintenance state to perform maintenance on the service, such as applying a patch. No new requests are handled in this state, but existing connections might be active. Administrator intervention is required to exit this state.
Use inetadm(8) to obtain the current state of a managed service.
As part of certain state transitions inetd will execute, if supplied, one of a set of methods provided by the service. The set of supported methods are:
inetd_start
inetd_offline
inetd_online
inetd_disable
inetd_refresh
The only compulsory method is the inetd_start method. In the absence of any of the others, inetd runs no method but behaves as if one was run successfully.
Configuration for SMF-managed services is stored in the SMF repository. The configuration is made up of the basic configuration of a service, the configuration for each of the service's methods, and the default configuration applicable to all inetd-managed services.
For details on viewing and modifying the configuration of a service and the defaults, refer to inetadm(8).
The basic configuration of a service is stored in a property group named inetd in the service. The properties comprising the basic configuration are as follows:
bind_addr
bind_fail_interval
bind_fail_max
con_rate_offline
connection_backlog
endpoint_type
failrate_cnt
failrate_interval
inherit_env
isrpc
max_con_rate
max_copies
name
proto
rpc_low_version
rpc_high_version
tcp_trace
tcp_trace is equivalent to the previous inetd's -t option (and the /etc/default/inetd property ENABLE_CONNECTION_LOGGING).
tcp_wrappers
For more information about configuring TCP wrappers, refer to tcpd(8) and hosts_access(5).
tcp_wrappers is equivalent to the previous inetd's /etc/default/inetd property ENABLE_TCPWRAPPERS.
wait
A number of the basic properties are optional for a service. In their absence, their values are taken from the set of default values present in the defaults property group in the inetd service. These properties, with their seed values, are listed below. Note that these values are configurable through inetadm(8).
bind_fail_interval -1 bind_fail_max -1 con_rate_offline -1 connection_backlog 10 failrate_count 40 failrate_time 60 inherit_env true max_con_rate -1 max_copies -1 tcp_trace false tcp_wrappers false
Each method specified for a service will have its configuration stored in the SMF repository, within a property group of the same name as the method. The set of properties allowable for these methods includes those specified for the services managed by svc.startd(8). (See svc.startd(8) for further details.) Additionally, for the inetd_start method, you can set the arg0 property.
The arg0 property allows external wrapper programs to be used with inetd services. Specifically, it allows the first argument, argv[0], of the service's start method to be something other than the path of the server program.
In the case where you want to use an external wrapper program and pass arguments to the service's daemon, the arguments should be incorporated as arguments to the wrapper program in the exec property. For example:
exec='/path/to/wrapper/prog service_daemon_args' arg0='/path/to/service/daemon'
In addition to the special method tokens mentioned in smf_method(7), inetd also supports the :kill_process token for wait-type services. This results in behavior identical to that if the :kill token were supplied, except that the kill signal is sent only to the parent process of the wait-type service's start method, not to all members of its encompassing process contract (see process(5)).
When configuring inetd for a sockets-based service, you have the choice, depending on what is supported by the service, of the alternatives described under the proto property, above. The following are guidelines for which proto values to use:
See EXAMPLES for an example of a configuration of a service that supports both IPv4 and IPv6.
inetd provides the methods listed below for consumption by the master restarter, svc.startd(8).
start
In addition, inetd also checks if the inetd.conf(5)-format configuration file it is monitoring has changed since the last inetconv(8) conversion was carried out. If it has, then a message telling the administrator to re-run inetconv to effect the changes made is logged in syslog.
stop
refresh
No options are supported.
configuration-file
start|stop|refresh
Example 1 Configuring a Service that Supports Both IPv4 and IPv6
The following commands illustrate the existence of services that support both IPv4 and IPv6 and assign proto properties to those services.
example# svcs -a | grep mysvc online 15:48:29 svc:/network/mysvc:dgram4 online 15:48:29 svc:/network/mysvc:dgram6 online 15:51:47 svc:/network/mysvc:stream4 online 15:52:10 svc:/network/mysvc:stream6 # inetadm -M network/rpc/mysvc:dgram4 proto=udp # inetadm -M network/rpc/mysvc:dgram6 proto=udp6only # inetadm -M network/rpc/mysvc:stream4 proto=tcp # inetadm -M network/rpc/mysvc:stream6 proto=tcp6only
See svcs(1) and inetadm(8) for descriptions of those commands.
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Evolving |
svcs(1), syslog(3C), getnetconfigent(3NSL), getrpcbyname(3NSL), getservbyname(3SOCKET), inetd.conf(5), process(5), syslog.conf(5), attributes(7), smf(7), smf_method(7), fmd(8), inetadm(8), inetconv(8), svc.startd(8), svcadm(8), svccfg(8)
The inetd daemon performs the same function as, but is implemented significantly differently from, the daemon of the same name in Solaris 9 and prior Solaris operating system releases. In the current Solaris release, inetd is part of the Service Management Facility (see smf(7)) and will run only within that facility.
The /etc/default/inetd file has been deprecated. The functionality represented by the properties ENABLE_CONNECTION_LOGGING and ENABLE_TCP_WRAPPERS are now available as the tcp_trace and tcp_wrappers properties, respectively. These properties are described above, under "Service Properties".
May 13, 2017 | OmniOS |