YaST2 Developers Documentation: Configuration of inetd



functions
files
intro

Configuration of inetd

modules/Inetd.ycp
Data for configuration of inetd, input and output functions.
Representation of the configuration of inetd. Input and output routines.

Imports

  • Directory
  • Progress
  • Report
  • Service
  • Summary

Includes

  • inetd/routines.ycp

Structures

Global Variables

Global Functions

Local Functions

Info:

Structure service

 
 A service map looks like this:
 $[
* as seen on TV^H^H (x)inetd.conf:
   "service": string      // * different from equally named field above
   "rpc_version": string
   "socket_type": string
   "protocol": string
   "wait": boolean
   "max": integer         // inetd only
   "user": string         // *
   "group": string
   "server": string
   "server_args": string
   "comment": string      // possibly multiline, without #
   "enabled": boolean     // service is active
* bookkeeping fields:
   "iid": string          // internal id, use as table `id
                          //   Iid is necessary because there may be multiple variants
                          //   of the same service. See next for iid handling.
   "changed": boolean     // when writing, unchanged services are ignored
                          //   new services (created) must be set as changed
                          //   see changeLine() and see addLine() for more details
   "deleted": boolean     // when deleting, this is set to TRUE and changed
                          // must be set too (see deleteLine())
   "script": string	// which configuration file this comes from
   "package": string	// which rpm it is in
* other fields:
 When handling existing maps, take care to preserve any other fields
 that may be present!

  "unparsed": string	// what the agent could not parse
 ]

 path netd = .whatever.inetd or .whatever.xinetd;

 SCR::Read (.etc.inetd_conf.services) -> list of inetd configuration
 SCR::Read (.etc.xinetd_conf.services) -> list of xinetd configuration
 SCR::Write (.etc.inetd_conf.services, list) -> boolean
 SCR::Write (.etc.xinetd_conf.services, list) -> boolean

 "iid" handling:
 The agent (ag_netd) uses it to locate the service in the config
 files.  Its value should be considered opaque, except that
 ag_netd will check whether it contains a colon (:) and if not,
 consider it a new service.
 Thus new services get "new"+number.
 Non-installed services:
   in normal ui they appear only in the table and get "NI"+number
   in autoyast ui they get "inst"+number
 Where number is last_created
 

See:
autoyast docs.

global configured_service -> symbol

What service is in configuration process? Same values as netd_service except `both

global default_conf_inetd -> map<string, any>

Default configuration for inetd (all services in the distro)

global default_conf_xinetd -> map<string, any>

Default configuration for xinetd (all services in the distro)

global AbortFunction -> block<boolean>

Abort function return boolean return true if abort

global Abort () -> boolean

Abort function

Return value:
If AbortFunction not defined, returnes false

global modified -> boolean

Configuration was changed

global proposal_valid -> boolean

used in unused module inetd_proposal.ycp. This will be removed

global write_only -> boolean

For autoinstallation Write() process. Write_only means that the service will not be actually started, because it is done by init later. But also that the service data are only a patch to be applied to the system.

global auto_mode -> boolean

If autoinstallation mode (true), we do not want to install RPMs during configuration. Otherwise (false) we allow all.

global Modified () -> boolean

Data was modified? This function returnes modified variable.

Return value:
true if modified

global inetd_installed -> integer

hold informations about installed services (rpm -q exit code). 0 means installed, anything else means no or error
inetd_installed contains info about inetd

global xinetd_installed -> integer

xinetd_installed contains info about xinetd

global netd_service -> symbol

What service is ready for configuration?
`none means no available --- this is for AutoInstallation
`both means the selection dialog will be displayed (only one service can run)
`inetd inetd will be configured
`xinetd xinetd will be configured
in autoinst used in the sense of configured_service???

See:
configured_service

global inetd_conf -> list<map <string, any> >

 These variable holds inetd configuration.
 This is list of maps. Each map has the following structure:
   $[
     "comment": String,
     "comment_inside": String, // this is agent internal
     "enabled": boolean,
     "group": String,
     "user": String,
     "iid": String,
     "protocol": String,
     "rpc_version": String,
     "server": String,
     "server_args": String,
     "service": String,
     "socket_type": String,
     "unparsed": String,       // agent internal
     "wait": boolean
  ]
 

global xinetd_conf -> list<map <string, any> >

This variable holds xinetd configuration. The structure is the same as inetd_conf.

global netd_conf -> list<map <string, any> >

Holds configuration of selected service (service in configuration process). The name of this service is stored in configured_service. Structure of this variable is the same as inetd_conf or xinetd_conf.

global default_conf -> map <string, any>

Holds default configuration for currently edited superserver.

global inetd_status -> integer

Is inetd (or xinetd) running? These variables contains return values from Service::Status() calls.

global xinetd_status -> integer

This contains return value of following call:
Service::Status("xinetd");

global netd_status -> integer

Status of edited service (see WhatToConfigureDialog() in dialogs.ycp) Values are the same as (x)inetd_status.

global module_status -> symbol

Status of inetd module if autoinstallation mode. Used in Summary. This is the state of whole module. This variable is filled by Import(). Possible values are
`configured --- imported configuration data are valid
`not_configured --- configuration data are invalid

global last_created -> integer

This variable is used for new iid "generator"

global EnsureDefaultConfLoaded () -> void

Read default_conf_{inetd,xinetd}, if not already done

global Read () -> boolean

Read all inetd settings

Return value:
true on success

global MergeEditedWithSystem (services_t system_conf, services_t edited_conf) -> services_t

This function solves differences between new (after installing requested packages) xinetd configuration and the configuration edited by the user.

 In normal mode:
 take the system services
   if it matches a service in the ui (ServicesMatch)
     use the ui data
 (not-installed ones are not a part of netd_conf, they
 only enter the table in mergexinetdconfs)
 Deleted services: OK.
 Added services: a separate pass needed
 
TODO reduce the quadratic complexity.

Parameters:
system_conf holds new configuration (on the system)
edited_conf holds old configuration (UI)
Return value:
Returnes new solved xinetd configuration (ready for Write()).

global Write () -> boolean

Write all inetd settings

Return value:
true on success

global WriteOnly () -> boolean

Only Write settings

Return value:
True on success

global mergeAfterInstall (services_t system_c, services_t user_c) -> services_t

Merges autoinstall profile into the system configuration.

Parameters:
system_c holds new configuration (on the system)
user_c holds old configuration (auto: profile + defaults)
Return value:
Returnes new solved xinetd configuration (ready for Write()).
See:
MergeAyProfile

global mergeWithDefaults (services_t changes) -> services_t

merges imported changes with services defaults

Parameters:
changes imported changes
Return value:
complete configuration with user changes
See:
MergeAyProfile

global SafeRemove (map m, list keys) -> map

Removes keys from a map. Unlike the remove builtin, does not mind if the keys are already removed.

Parameters:
m a map
keys list of keys to remove
Return value:
the map without the specified keys

global MergeAyProfile (services_t target, services_t changes) -> services_t

Merges AY profile items into a target list (defaults or system).

Parameters:
target base list of services
changes imported changes
Return value:
merged list of services
See:
autoyast docs.

local ConvertSles8Profile (map settings) -> map

Convert from SLES8 AI profile

Parameters:
settings

global Import (map settings) -> boolean

Get all inetd settings from the first parameter (For use by autoinstallation.)

Parameters:
settings The YCP structure to be imported.
Return value:
True on success

global getChanged (services_t config) -> services_t

Get only changed entries

Parameters:
config complete configuration
Return value:
Returnse list of changes only

global Export () -> map

Dump the inetd settings to a single map (For use by autoinstallation.)

Return value:
Dumped settings (later acceptable by Import ())

global mkeServiceSummary () -> string

Create unsorted list of enabled services

Return value:
Returnes string with RichText-formated list

global Summary () -> string

Create a textual summary and a list of unconfigured cards

Return value:
summary of the current configuration

global deleteLine (any line_number) -> void

delete line in netd_conf

Parameters:
line_number "iid" geted from table's item ID

global addLine (service_t new_line) -> void

add a line in DB

Parameters:
new_line new_line contains new entry for global netd_conf configuration

global changeLine (service_t new_line, any line_number) -> void

Change a line in DB

Parameters:
new_line new_line contains changes for entry in netd_conf
line_number line_number contains iid of changed entry in netd_conf

global AutoPackages () -> map

Return required packages for auto-installation FIXME: Need to make this return the needed packages during installation

Return value:
of packages to be installed and to be removed

YaST2 Developers Documentation