231. RunlevelEd

Data for configuration of services, input and output functions.

231.1. Authors

  • Martin Vidner <mvidner@suse.cz>

  • Petr Blahos <pblahos@suse.cz>

  • Martin Lazar <mlazar@suse.cz>

231.2. Summary of Module Globals

List of Global Functions

  • CheckPortmap - Check for portmap. Portmap should be started if inetd, nfs, nfsserver, nis, ... is started. This checks the dependency.

  • ClearServices - Set all dirty services as clean and tries to read original "start"/"stop" for them.

  • DotRequires -

  • Export - Export user settings.

  • FilterAlreadyDoneServices - Gets a list of dependent services and a target state they should be in. Filters out those that are already in the target state. If both init_time and run_time are on, a conjunction is needed.

  • GetModified - Returns true if the settings were modified

  • GetRunlevel4Support - Returns whether runlevel 4 is supported in RLEd.

  • Import - Import user settings

  • Init - Init function.

  • ProposalSummary -

  • Read - Read settings

  • ServiceDependencies - Resolve which services need to be enabled/disabled

  • ServiceInstall - Enable specified service, and all required services.

  • ServiceRemove - Disable specified service, and all dependence services.

  • SetModified - Function sets an internal variable indicating that any settings were modified to "true". Used for autoinst cloning.

  • SetRunlevel4Support - Sets whether runlevel 4 should be supported.

  • StartContainsImplicitly - Is a service started in a runlevel, given the list of rulevels it is started in? This looks like a simple contains, but "B" implicitly expands to all runlevels. See also bug #17234.

  • Summary -

  • Write - Save changed services into proper runlevels. Save also changed default runlevel.

  • getDefaultPicker - Returns items for default runlevel combo box. (Excludes 0, 1, 6, S and B)

  • getRunlevelDescr - Returns textual runlevel description. Descriptions are hard-coded in ycp script.

  • isDirty - Were some settings changed?

  • isDisabled - Is a service disabled? Checks whether the default runlevel is in the list of runlevels

List of Global Variables

  • current - Current runlevel

  • default_runlevel - Default runlevel (after boot)

  • runlevels - List of all runlevels available in the system.

  • service_list - List of all service names. Filled by Read, used to get all services' status.

  • services - List of all services. Each item is a map described above. @ref service

  • x11_selected - Proposal parameter: if it changes, we repropose

231.3. Global Functions

231.3.1. CheckPortmap

Check for portmap. Portmap should be started if inetd, nfs, nfsserver, nis, ... is started. This checks the dependency.

Return value

  • string - name of the first enabled service that requires portmap

231.3.2. ClearServices

Set all dirty services as clean and tries to read original "start"/"stop" for them.

Return value

  • void

231.3.3. DotRequires

Return value

  • string - a graphviz graph of the service dependencies

231.3.4. Export

Export user settings.

Return value

  • map - user settings:<pre>$[ "services": $[ map of dirty services ], "default": the default runlevel, if changed, ]</pre>

231.3.5. FilterAlreadyDoneServices

Gets a list of dependent services and a target state they should be in. Filters out those that are already in the target state. If both init_time and run_time are on, a conjunction is needed.

Function parameters

  • list<string> svcs

  • list<string> rls

  • boolean enable

  • boolean init_time

  • boolean run_time

Return value

  • list<string>

231.3.6. GetModified

Returns true if the settings were modified

Return value

  • boolean - settings were modified

231.3.7. GetRunlevel4Support

Returns whether runlevel 4 is supported in RLEd.

Return value

  • boolean - supported

231.3.8. Import

Import user settings

Function parameters

  • map s

Return value

  • boolean - success state

See also:

  • Export

231.3.9. Init

Init function.

Return value

  • void

See also:

  • FATE #303798: YaST2 runlevel editor: offer easy enablement and configuration of runlevel 4

231.3.10. ProposalSummary

Return value

  • string - Html formatted summary for the installation proposal

231.3.11. Read

Read settings

Return value

  • boolean - success

231.3.12. ServiceDependencies

Resolve which services need to be enabled/disabled

Function parameters

  • string service

  • boolean enable

Return value

  • list<string> - a list of services (excluding itself) required to start a service (enable) or to be stopped because they require the service (disable), ordered by their dependencies. Missing services are included, system facilities excluded.<br> If dependencies are disabled, returns an empty list, as if there were no dependencies.

231.3.13. ServiceInstall

Enable specified service, and all required services.

Function parameters

  • string service

  • list<string> rls

Return value

  • integer - 0 = ok, 1 = service not found

231.3.14. ServiceRemove

Disable specified service, and all dependence services.

Function parameters

  • string service

  • list<string> rls

Return value

  • integer - 0 = ok

231.3.15. SetModified

Function sets an internal variable indicating that any settings were modified to "true". Used for autoinst cloning.

Return value

  • void

231.3.16. SetRunlevel4Support

Sets whether runlevel 4 should be supported.

Function parameters

  • boolean new_state

Return value

  • void

See also:

  • FATE #303798

231.3.17. StartContainsImplicitly

Is a service started in a runlevel, given the list of rulevels it is started in? This looks like a simple contains, but "B" implicitly expands to all runlevels. See also bug #17234.

Function parameters

  • list<string> rls

  • string rl

Return value

  • boolean - should it be running in rl?

231.3.18. Summary

Return value

  • string - Html formatted configuration summary

231.3.19. Write

Save changed services into proper runlevels. Save also changed default runlevel.

Return value

  • boolean - success

231.3.20. getDefaultPicker

Returns items for default runlevel combo box. (Excludes 0, 1, 6, S and B)

Function parameters

  • symbol mode

Return value

  • list - List of items. Default is selected.

231.3.21. getRunlevelDescr

Returns textual runlevel description. Descriptions are hard-coded in ycp script.

Function parameters

  • string rl

Return value

  • string - Description.

231.3.22. isDirty

Were some settings changed?

Return value

  • boolean - true if yes

231.3.23. isDisabled

Is a service disabled? Checks whether the default runlevel is in the list of runlevels

Function parameters

  • map service

Return value

  • boolean - true if service is disabled

231.4. Global Variables

231.4.1. current

Current runlevel

231.4.2. default_runlevel

Default runlevel (after boot)

231.4.3. runlevels

List of all runlevels available in the system.

231.4.4. service_list

List of all service names. Filled by Read, used to get all services' status.

231.4.5. services

List of all services. Each item is a map described above. @ref service

231.4.6. x11_selected

Proposal parameter: if it changes, we repropose

231.5. Module Requirements

231.5.1. Module Imports

  • CommandLine
  • ProductControl
  • ProductFeatures
  • Progress
  • Report
  • Service
  • Summary

231.5.2. Module Includes

  • runlevel/toposort.ycp