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
Includes
StructuresGlobal Variables
Global Functions
|
Structure service
<pre> 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 </pre>
- See
-
autoyast docs.
Abort function return boolean return true if abort
Abort function
- Return value:
-
If AbortFunction not defined, returnes false
Configuration was changed
used in unused module inetd_proposal.ycp. This will be removed
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.
If autoinstallation mode (true), we do not want to install RPMs during configuration. Otherwise (false) we allow all.
Autoyast now does not initially call Import $[] anymore. But our design is so broken that we need it and will work hard to achieve it.
Data was modified? This function returnes modified variable.
- Return value:
-
true if modified
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 ]
Is xinetd running? These variables contains return values from Service::Status() calls.
This variable is used for new iid "generator"
Read all inetd settings
- Return value:
-
true on success
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 neededTODO 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()).
Write all inetd settings
- Return value:
-
true on success
Only Write settings
- Return value:
-
True on success
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
merges imported changes with services defaults
- Parameters:
-
changes imported changes
- Return value:
-
complete configuration with user changes
- See
-
MergeAyProfile
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
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.
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
Get only changed entries
- Parameters:
-
config complete configuration
- Return value:
-
Returnse list of changes only
Dump the inetd settings to a single map (For use by autoinstallation.)
- Return value:
-
Dumped settings (later acceptable by Import ())
Create unsorted list of enabled services
- Return value:
-
Returnes string with RichText-formated list
Create a textual summary and a list of unconfigured cards
- Return value:
-
summary of the current configuration
delete line in netd_conf
- Parameters:
-
line_number "iid" geted from table's item ID
add a line in DB
- Parameters:
-
new_line new_line contains new entry for global netd_conf configuration
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
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