173. NtpClient

Data for configuration of ntp-client, input and output functions.

173.1. Authors

  • Jiri Srain <jsrain@suse.cz>

173.2. Summary of Module Globals

List of Global Functions

List of Global Variables

  • ad_controller - Active Directory controller

  • change_firewall - Should the firewall settings be changed?

  • firewall_services - ports in firewall to open

  • modified - Data was modified?

  • ntp_policy - Netconfig policy: for merging and prioritizing static and DHCP config. FIXME get a public URL https://svn.suse.de/svn/sysconfig/branches/mt/dhcp6-netconfig/netconfig/doc/README

  • ntp_records - Read all ntp-client settings

  • random_pool_servers - List of servers defined by the pool.ntp.org to get random ntp servers

  • required_packages - Required packages

  • run_chroot - Should the daemon be started in chroot environment?

  • run_service - Should the daemon be started when system boots?

  • selected_index - Index of the currently sellected item

  • selected_record - The currently sellected item

  • service_name - Service name of the NTP daemon

  • write_only - Write only, used during autoinstallation. Don't run services and SuSEconfig, it's all done at one place.

173.3. Global Functions

173.3.1. ActivateRandomPoolServersFunction

Add servers needed for random_pool_servers function into the current configuration.

Return value

  • void

173.3.2. AutoPackages

Return required packages for auto-installation

Return value

  • map - of packages to be installed and to be removed

173.3.3. DeActivateRandomPoolServersFunction

Removes all servers contained in the random_pool_servers list from the current configuration.

Return value

  • void

173.3.4. DetectNtpServers

Detect NTP servers present in the local network

Function parameters

  • symbol method

Return value

  • list<string> - a list of found NTP servers

173.3.5. Export

Dump the ntp-client settings to a single map (For use by autoinstallation.)

Return value

  • map - Dumped settings (later acceptable by Import ())

173.3.6. GetAllKnownCountries

Reads and returns all known countries with their country codes

Return value

  • map <string, string> - of known contries

$[
   "CL" : "Chile",
   "FR" : "France",
   ...
 ]

173.3.7. GetCountryNames

Get the mapping between country codea and names ("CZ" -> "Czech Republic")

Return value

  • map<string, string> - a map the country codes and names mapping

173.3.8. GetCurrentLanguageCode

Read current language (RC_LANG from sysconfig)

Return value

  • string - two-letter language code (cs_CZ.UTF-8 -> CZ)

173.3.9. GetNtpServers

Get the list of known NTP servers

Return value

  • map<string, map<string,string> > - a list of known NTP servers

173.3.10. GetNtpServersByCountry

Get list of public NTP servers for a country

Function parameters

  • string country

  • boolean terse_output

Return value

  • list - of servers (usable as combo-box items)

173.3.11. GetUsedNtpServers

Function returns list of NTP servers used in the configuration.

Return value

  • list <string> - of servers

173.3.12. Import

Get all ntp-client settings from the first parameter (For use by autoinstallation.)

Function parameters

  • map settings

Return value

  • boolean - True on success

173.3.13. IsRandomServersServiceEnabled

Checks whether all servers listed in the random_pool_servers list are used in the configuration.

Return value

  • boolean - true if enabled

173.3.14. ProcessNtpConf

Read and parse /etc.ntp.conf

Return value

  • boolean - true on success

173.3.15. Read

Read all ntp-client settings

Return value

  • boolean - true on success

173.3.16. Summary

Create a textual summary and a list of unconfigured cards

Return value

  • string - summary of the current configuration

173.3.17. TestNtpServer

Test if specified NTP server answers

Function parameters

  • string server

  • symbol verbosity

Return value

  • boolean - true if NTP server answers properly

173.3.18. Write

Write all ntp-client settings

Return value

  • boolean - true on success

173.3.19. deleteSyncRecord

Delete specified synchronization record

Function parameters

  • integer index

Return value

  • boolean - true on success

173.3.20. enableOptionInSyncRecord

Ensure that selected_record["options"] contains the option. (A set operation in a string)

Function parameters

  • string option

Return value

  • void

173.3.21. findSyncRecord

Find index of synchronization record

Function parameters

  • string type

  • string address

Return value

  • integer - index of the record if found, -1 otherwise

173.3.22. getSyncRecords

Get the list of synchronization-related records

Return value

  • list<map<string,any> > - a list of maps with keys type (eg. "server"), address and index.

173.3.23. selectSyncRecord

Select synchronization record

Function parameters

  • integer index

Return value

  • boolean - true on success

173.3.24. storeSyncRecord

Store currently sellected synchronization record

Return value

  • boolean - true on success

173.4. Global Variables

173.4.1. ad_controller

Active Directory controller

173.4.2. change_firewall

Should the firewall settings be changed?

173.4.3. firewall_services

ports in firewall to open

173.4.4. modified

Data was modified?

173.4.5. ntp_policy

Netconfig policy: for merging and prioritizing static and DHCP config. FIXME get a public URL https://svn.suse.de/svn/sysconfig/branches/mt/dhcp6-netconfig/netconfig/doc/README

173.4.6. ntp_records

Read all ntp-client settings

173.4.7. random_pool_servers

List of servers defined by the pool.ntp.org to get random ntp servers

See also:

  • http://www.pool.ntp.org/

173.4.8. required_packages

Required packages

173.4.9. run_chroot

Should the daemon be started in chroot environment?

173.4.10. run_service

Should the daemon be started when system boots?

173.4.11. selected_index

Index of the currently sellected item

173.4.12. selected_record

The currently sellected item

173.4.13. service_name

Service name of the NTP daemon

173.4.14. write_only

Write only, used during autoinstallation. Don't run services and SuSEconfig, it's all done at one place.

173.5. Module Requirements

173.5.1. Module Imports

  • Directory
  • FileChanges
  • FileUtils
  • Language
  • Message
  • Mode
  • NetworkInterfaces
  • PackageSystem
  • Popup
  • Progress
  • Report
  • SLPAPI
  • Service
  • Stage
  • String
  • SuSEFirewall
  • Summary

173.5.2. Module Includes