Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Cme: a tool to edit and validate configuration files

154 views

Published on

These slides presents the main features of Cme: the CLI, the GUI and the main commands to check, modify, fix or edit configuration files.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Cme: a tool to edit and validate configuration files

  1. 1. cme: Check or edit configuration files Dominique Dumont Debian Project May 2018 Dominique Dumont cme: Check or edit configuration files
  2. 2. What is cme ? A tool to check the semantic content or modify configuration files content with: a CLI a shell a curses interface a GUI Purpose: help beginners discover application possibilities (online help) handle migration of old configuration files help package upgrade by merging user conf with upstream changes (see lcdproc) provide safe way to script configuration file modification Dominique Dumont cme: Check or edit configuration files
  3. 3. Which configuration files ? $ cme list system ( system configuration files. Use sudo to run cme ): approx lcdproc popcon sshd system-ssh systemd user ( user configuration files ): ssh systemd-user application ( miscellaneous application configuration ): dpkg dpkg-control dpkg-copyright dpkg-patch dpkg-patches multistrap systemd-service systemd-socket systemd-timer Dominique Dumont cme: Check or edit configuration files
  4. 4. Validate semantic content normal case $ cme check lcdproc cme: using LCDd model loading data checking data check done Dominique Dumont cme: Check or edit configuration files
  5. 5. Detect semantic error in value file with a wrong value ReportToSyslog = oui error detection $ cme check lcdproc cme: using LCDd model loading data Configuration item ’server ReportToSyslog’ has a wrong value: error: ’oui’ is not boolean, i.e. not ’no’ or ’yes’ Dominique Dumont cme: Check or edit configuration files
  6. 6. Error correction with CLI 1/2 First try with cme modify: $ sudo cme modify lcdproc ’server ReportToSyslog=yes’ cme: using LCDd model Configuration item ’server ReportToSyslog’ has a wrong value: error: ’oui’ is not boolean, i.e. not ’no’ or ’yes’ cme refuses to load a corrupted file Dominique Dumont cme: Check or edit configuration files
  7. 7. Error correction with CLI 2/2 cme refuses to load a corrupted file, so use -force option: $ sudo cme modify lcdproc ’server ReportToSyslog=yes’ -force cme: using LCDd model Changes applied to lcdproc configuration: - server ReportToSyslog: ’no’ -> ’yes’ Dominique Dumont cme: Check or edit configuration files
  8. 8. Warning detection Some warnings can be be fixed by cme: $ cme check dpkg cme: using Dpkg model loading data Reading package lists... Done Building dependency tree Reading state information... Done Warning in ’control source Standards-Version’ value ’4.1.3’: Current standards version is ’4.1.4’. Please read https://www.[...] Warning in ’control source Vcs-Browser’ value ’https://anonscm.debian.org/[...]’: URL is not the canonical one for repositories hosted on Debian infrastructure. Warning in ’control source Vcs-Git’ value ’https://anonscm.debian.org/[...]’: URL is not the canonical one for repositories hosted on Debian infrastructure. checking data check done you can try ’cme fix dpkg’ to fix the warnings shown above Dominique Dumont cme: Check or edit configuration files
  9. 9. Warnng correction Warning correction can be manual or automatic: $ cme fix dpkg cme: using Dpkg model cme: running fix on dpkg configuration... Reading package lists... Done Building dependency tree Reading state information... Done [ ... same warnings ...] Changes applied to dpkg configuration: - control source Standards-Version has new value: ’4.1.4’ # applied fix for :Current standards version is ’4.1.4’. Please read https://www.debian.org/doc/[...] for the changes that may be needed on your package to upgrade it from standard version ’4.1.3’ to ’4.1.4’. - control source Vcs-Browser has new value: ’https://salsa.[...]’ # applied fix for :URL is not the canonical one for repositories hosted on Debian infrastructure. - control source Vcs-Git has new value: ’https://salsa.[...]’ # applied fix for :URL is not the canonical one for repositories hosted on Debian infrastructure. Dominique Dumont cme: Check or edit configuration files
  10. 10. cme script cme scripts can be used for repetitive operations: $ cme run <TAB> <TAB> add-me-to-uploaders paste-license update-copyright bump-dependency-version remove-uploader update-my-copyright-year -list set-vcs-git $ cme run update-my-copyright-year -doc update my copyright year only copyright of last year is updated will commit with message: ’updated copyright year of Dominique Dumont’ $ cme run update-my-copyright-year cme: using Dpkg::Copyright model Changes applied to dpkg-copyright configuration: - Files:"lib/*" Copyright: ’2013-2017, Dominique Dumont.’ -> ’2013-2018, Dominique Dumont.’ - Files:"script/*" Copyright: ’2013-2017, Dominique Dumont.’ -> ’2013-2018, Dominique Dumont.’ [master 1d03cd73] updated copyright year of Dominique Dumont 1 file changed, 3 insertions(+), 3 deletions(-) Dominique Dumont cme: Check or edit configuration files
  11. 11. GUI examples With ’sudo cme edit lcdproc’: Dominique Dumont cme: Check or edit configuration files
  12. 12. Demo ... if I did not speak too much Dominique Dumont cme: Check or edit configuration files
  13. 13. Next time: under the hood During next presentation(s), we’ll see: how these check and GUI are generated from a model how to update a model (with cme meta edit) what are the pro and cons of creating a cme model for a project how to create a cme script next development steps for cme Dominique Dumont cme: Check or edit configuration files
  14. 14. For more information installation instructions config-model wiki config-model blog http://wiki.debian.org/PackageConfigUpgrade https://github.com/dod38fr/config-model/wiki/Managing- Lcdproc-configuration-with-cme Dominique Dumont cme: Check or edit configuration files

×