[Thinlinc-technical] Migrate configuration during ThinLinc upgrade
Pot, Willem
willem.pot at office.ziggo.nl
Sun Feb 14 15:25:04 CET 2016
Hi Peter,
Sorry for the late answer but I totally missed the discussion.
Still I like to share my thoughts.
Did you have a look at Augeas? (http://augeas.net)
Augeas is a tool that makes it possible to deal with upstream changes and local modifications.
It would be nice to have a thinlinc.aug file distributed together with a ThinLinc upgrade.
I tried it with a copy of dput.aug but had trouble with the leading "/" in the section headers inside the *.hconf files.
That would mean using [vsm] instead of [/vsm], but I'm not sure if this would break anything.
Augtool can be used to inspect and modify the ThinLinc config files.
To keep track of local modifications I would suggest a Configuration Management tool like Salt (http://saltstack.com).
Salt has support for Augeas (https://docs.saltstack.com/en/latest/ref/states/all/salt.states.augeas.html), and when you use gitfs as backend for the Salt states, you have version control as well via git.
Thinking further I would suggest a ThinLinc Saltstack Formula like in (https://github.com/saltstack-formulas).
Of course there are other tools for configuration management like Puppet, Ansible, Chef and the like.
I hope this answers part of your question and thank you for making ThinLinc.
Best regards,
Willem Pot
-----Original Message-----
From: Thinlinc-technical [mailto:thinlinc-technical-bounces at lists.cendio.se] On Behalf Of Peter Astrand
Sent: Thursday, December 10, 2015 2:42 PM
To: thinlinc-technical at lists.cendio.se
Subject: [Thinlinc-technical] Migrate configuration during ThinLinc upgrade
Hi. We are thinking about improving the configuration handling during a ThinLinc upgrade, and wants to share our thoughts with you, in order to get some feedback.
As you probably know, ThinLinc uses the "Hiveconf" configuration system, where parameter/value pairs are stored in an abstract folder-like namespace. In practice, parameters are stored in text files below /opt/thinlinc/etc/conf.d/. These files are marked as configuration files, in order to get some special attention by the package managers (RPM/DPKG).
What happens during upgrade depends on if the file has been changed in the updated package and/or on disk. In most cases, the package manager can determine what to do. Only one case is problematic: If a particular file is changed both in the updated package and on disk (by the admin). When this happens, the package manager will install the new file from the updated package, and save the edited file in .rpmsave or .dpkg-old. (See http://www-uxsup.csx.cam.ac.uk/~jw35/docs/rpm_config.html and https://raphaelhertzog.com/2010/09/21/debian-conffile-configuration-file-managed-by-dpkg/
for details).
Currently, the ThinLinc installer will not allow you to proceed with running "tl-setup" directly after an upgrade (regardless of whether any .rpmsave or .dpkg-old files were actually created), but instead advise you to check for such files and review them to make sure your system is correctly configured. You need to review the differences between the old and the new files, and add relevant statements from the old files to the new files, before proceeding with tl-setup. Depending on how much has changed, this task can range from very simple to mindboggling. It is possible to simply rename the saved files to .hconf and continue using the old files as-is, but there are a few problems with this approach as well (see below).
We want to improve this situation, and perhaps provides 2-3 different options in tl-setup, but wants to get your feedback about which options to include, and perhaps if any of these should be marked as default. There are different pros and cons with all options. This includes:
* If the existing configuration is preserved or not. If not, the administrator has to change all relevant parameters again, using the Web interface, tl-config, or edit the .hconf files manually.
* If the configuration is guaranteed to work good with the new version.
Although unlikely, it is possible that the old configuration does not work with the new version. For example, a certain parameter value is perhaps longer be supported.
* If default values are taken from the new or old ThinLinc version. When we are changing a default value, you as a customer might either prefer the old or new value, depending on many things. Computer code cannot determine what is "best".
* If comments and file structure (such as the order of parameters, or even the file name) is preserved or not. In some cases, you might want to stay as close to the shipped configuration files as possible. This makes is easier to use tools such as "diff" to compare changes. In other cases, the configuration files might have a custom structure, many customer specific comments etc.
* If new parameters are available visible in the configuration files or not.
The different options we are discussing now are:
1) Use the "new" files from the updated packages. This is how it works
today, if you do not do anything between running install-server and
tl-setup. This option has the following properties:
Preserves existing configuration?: NO
Conf. guaranteed to work with new version? YES
Default values?: NEW
Comments and file structure?: NEW
New parameters visible?: YES
2) Use the "old" files. The .rpmsave/.dpkg-old files are simply renamed
into place.
Preserves existing configuration?: YES
Conf. guaranteed to work with new version? NO
Default values?: OLD
Comments and file structure?: OLD
New parameters visible?: NO
3) Base the configuration on the new files, but import values from the old
file. I have written a tool that basically loops over the parameters in
all .rpmsave/.dpkg-old and "imports" the parameter values into the
active configuration (which is based on the new files). This means that
the perceived configuration (say, for end users) is the same as before
the upgrade.
Preserves existing configuration?: YES
Conf. guaranteed to work with new version? NO
Default values?: OLD
Comments and file structure?: NEW
New parameters visible?: YES
I'm personally quite fond of solution 3 (migrate), so my initial idea was
to have that as the default option in tl-setup, but also make it possible
to opt out for such a migration, which means solution 1 (new files)
instead (since that is what the package manager gives you). It would also
be possible to get solution 2 (old files) by exiting tl-setup and, say,
manually renaming files.
However, we are considering other alternatives as well. This includes but
is not limited to: not having any default, providing an option for
solution 2 (old files) as well etc. Or perhaps the current implementation
is sufficient?
Since it's somewhat difficult to describe all this in text, I'm attaching
a screenshot of what it could look like.
What do you think? Any feedback is appreciated.
Regards,
---
Peter Astrand ThinLinc Chief Developer
Cendio AB https://cendio.com
Teknikringen 8 https://twitter.com/ThinLinc
583 30 Linkoping https://facebook.com/ThinLinc
Phone: +46-13-214600 https://google.com/+CendioThinLinc
________________________________
This message is confidential and may be privileged. Any review, retransmission, dissemination or other use of, taking any action with reference to this information by persons other than the intended recipient is prohibited. If you receive this message in error, please notify the sender by reply e-mail and delete this message from all computers. Please note that e-mails are susceptible to change. The sender will not accept liability for the improper or incomplete transmission of the information contained in this message.
Spaar het milieu door deze e-mail niet te printen/Please consider the environment before printing this email.
More information about the Thinlinc-technical
mailing list