Bug 7163 - Old ThinLinc services are running after package upgrade
Summary: Old ThinLinc services are running after package upgrade
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Server Installer (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.15.0
Assignee: Linn
URL:
Keywords: relnotes, samuel_tester, tobfa_tester
Depends on: 3744
Blocks:
  Show dependency treegraph
 
Reported: 2018-04-26 13:10 CEST by Samuel Mannehed
Modified: 2022-04-27 15:42 CEST (History)
4 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Samuel Mannehed cendio 2018-04-26 13:10:01 CEST
After upgrading ThinLinc's server packages, the services are not stopped. That means that the services are running old (not-upgraded) code while all ThinLinc files on disk have been upgraded.

This is not a scenario that we have much control over and not something we test internally. It is difficult to support.

For an example of an issue due to this see comment 14 on bug 7161.
Comment 1 Samuel Mannehed cendio 2018-04-26 13:17:05 CEST
From comment 14 on bug 7161:

> It's imperative that you restart the vsmagent service as quickly as
> possible after installing upgraded packages.
> 
> If you do not do this in a timely fashion, previously scheduled
> session verification tasks will run old code in vsmagent that will
> effectively make any running sessions unreachable if a user
> disconnects.
> 
> Take into account that the administrator _must_ run tl-setup, deal
> with the configuration changes that happened during the 4.9.0 cycle,
> wait for the SELinux module, CUPS, printers, etc. This can easily
> take a minute for an experienced ThinLinc Developer, so it's easy to
> imagine scenarios where this takes 2-5 minutes or more for Joe
> Schmoe, system administrator.
> 
> As for me, I went for lunch during tl-setup and came back to an
> upgraded system that had lost sessions.

We have decided to do fix this now for ThinLinc 4.9.0. We will stop the ThinLinc services after the package upgrade.

We will also clarify the implications of this in the TAG:

 * New sessions can not be created until tl-setup has been completed.

 * Users can continue working on running sessions but will not benefit from bugfixes or new features from the new release.

 * Users can not reconnect to existing disconnected sessions until tl-setup has been completed.

 * Due to the above remarks we recommend a service-window for ThinLinc server upgrades
Comment 2 Samuel Mannehed cendio 2018-04-26 13:18:50 CEST
Note bug 7112 and bug 7113.
Comment 4 Samuel Mannehed cendio 2018-04-26 16:10:14 CEST
Upgrading to new packages will now automatically stop the services. I built both the .rpm and .deb on my workstation and verified this:

 * thinlinc-vsm upgrade on fedora => both vsmserver and vsmagent stopped
 * thinlinc-vsm upgrade on ubuntu => both vsmserver and vsmagent stopped
 * thinlinc-webaccess upgrade on fedora => tlwebaccess stopped
 * thinlinc-webaccess upgrade on ubuntu => tlwebaccess stopped
 * thinlinc-tladm upgrade on fedora => tlwebadm stopped
 * thinlinc-tladm upgrade on ubuntu => tlwebadm stopped
Comment 8 Samuel Mannehed cendio 2018-04-26 17:05:07 CEST
Documentation and release note updated now as well. Tester should verify that ThinLinc services are stopped during package upgrades on both .deb and .rpm systems. That the issue described in comment 1 is fixed should also be verified.
Comment 11 Pierre Ossman cendio 2018-05-02 14:14:13 CEST
We're doing a different workaround for bug 7161 so we'll delay addressing the problem described here.
Comment 12 Pierre Ossman cendio 2021-01-26 13:36:40 CET
This is also causing a problem in bug 7578 as a result of upgrading from SysV scripts to systemd units (bug 4290). If the tlwebaccess service would have been stopped before the upgrade then things would work better.
Comment 13 Pierre Ossman cendio 2021-01-27 11:04:21 CET
A temporary hack has been added in bug 7578 that should be removed once this bug is fixed.
Comment 15 Linn cendio 2022-04-21 12:24:20 CEST
Tested upgrading from 4.11.0, 4.12.0 and 4.12.1 on RHEL 8 and Ubuntu 20.04. Also tested "upgrading" from the version with the fix to the exact same version, using these commands on the respective dists:
> rpm -Uvh --replacepkgs <server rpm>
> deb --install <server deb>
Note that on deb, I couldn't test upgrading from 4.11.0. due to a bug related to bug 4885 (see bug 4885 comment 91) which prevents our packages from being uninstalled.

Services turned off after upgrade (before tl-setup):
                  rpm | deb
  4.11.0           ✓  |  ✗ 
  4.12.0           ✓  |  ✓
  4.12.1           ✓  |  ✓
  Same version     ✓  |  ✓
  
Cannot start new sessions until tl-setup is finished:
                  rpm | deb
  4.11.0           ✓  |  ✗ 
  4.12.0           ✓  |  ✓
  4.12.1           ✓  |  ✓
  Same version     ✓  |  ✓
  
Old sessions which still are connected are usable as normal:
                  rpm | deb
  4.11.0           ✓  |  ✗ 
  4.12.0           ✓  |  ✓
  4.12.1           ✓  |  ✓
  Same version     ✓  |  ✓
  
Can't reconnect to old session until tl-setup is finished:
                  rpm | deb
  4.11.0           ✓  |  ✗ 
  4.12.0           ✓  |  ✓
  4.12.1           ✓  |  ✓
  Same version     ✓  |  ✓


Also tested that you still can reconnect to old sessions on RHEL 7 after upgrade (bug 7161) when upgrading from 4.12.0.
Comment 16 Linn cendio 2022-04-21 12:51:07 CEST
(In reply to Linn from comment #15)
> ...
> > deb --install <server deb>
Typo in this command, should be
> dpkg --install <server deb>
Comment 17 Linn cendio 2022-04-21 14:14:55 CEST
Also tested that this change did not cause issues for bug 7578. Tested on Fedora 35 and Ubuntu 20.04

Sessions are not dropped on restart of tlwebaccess service
  ✓ Fedora 35
  ✓ Ubuntu 20.04
  
Sessions should not be dropped when upgrading from:
                  rpm | deb
  4.11.0           ✓  |  ✗*
  4.12.0           ✓  |  ✗**
  4.12.1           ✓  |  ✓

  *) Currently we can't upgrade from versions due to a bug that causes our packages to be uninstallable (bug 4885 comment 91)
  **) Users are disconnected when upgrading, also due to bug 4885.
Comment 18 Linn cendio 2022-04-22 09:39:12 CEST
When changing from multiple server packages into a single package in bug 4885, it has the unintended side effect that the services for the old packages are stopped, since the old packages are considered uninstalled and not upgraded. This happens on both rpm and deb systems.

Luckily for us, we want the old services to be turned off, so that in itself is not an issue. However, when trying to remove the temporary hack added in bug 7578, everything works fine, despite that it should be broken. 

I'll try to examine why we get this behaviour by looking at how our preuninstall script works.
Comment 19 Linn cendio 2022-04-25 12:54:05 CEST
(In reply to Linn from comment #18)
> ..., when trying to remove the temporary hack added in
> bug 7578, everything works fine, despite that it should be broken. 
There has been some going back and forth between if this hack still is needed or if it should be removed. We have reached the conclusion that comment 13 is correct, and hence the temporary hack should be removed.

As a side note, the hack is only used when upgrading from a version that uses sysv, otherwise it is skipped.


> I'll try to examine why we get this behaviour by looking at how our
> preuninstall script works.
Since the hack is to be removed, I have rather checked that Red Hat and SLES distributions all handle our preuninstall script in the same way when upgrading from 4.11.0 (i.e. from sysv). Below are the dists I tested, and the services all started correctly on upgrade with the hack removed.

  ✓ RHEL 8
  ✓ RHEL 7
  ✓ Fedora 35
  ✓ SLES 12
  ✓ SLES 15

I did not test upgrading on a deb system due to the issue mentioned in comment 17.
Comment 26 Linn cendio 2022-04-26 14:42:44 CEST
Changed so that our services always are stopped in our preinstall script if they are running, instead of just being stopped when it is considered an upgrade. This makes sure we have the right behaviour even for renames or the like, where the system does not consider it a 'true' upgrade but rather an uninstall and install.

Tested that services are correctly stopped when upgrading from 4.11.0 on RHEL 8, and that they also are stopped when 'upgrading' to the same package on both RHEL 8 and Ubuntu 20.04


Since this bug ended up a bit intertwined with bug 4885, the issue with dropped webaccess sessions has been tested there (see bug 4885 comment 109).

What is left for the tester to check is:

  * Services are stopped on upgrade, both for rpm and deb.

  * If possible, come up with any additional scenario where the removal of the workaround could cause issues. The workaround was only concerning the issue in bug 7578 comment 4.
Comment 27 Samuel Mannehed cendio 2022-04-27 14:40:18 CEST
This change will only have effects on upgrades AFTER tl-4.15.0 due to side effects from bug 4885. Because of this, I have tested upgrading between two jenkins builds - 2594 and 2595. Both these jenkins builds include the new single thinlinc-server package (bug 4885) and the change made on this bug.

For DEB we also wanted to test on something very recent so I chose Ubuntu 22.04 which was just released:

 * Services are stopped after running install_server to upgrade from build 2594 to build 2595.
 * Services are started again after completing tl-setup of the 2595 upgrade.
 * A Web Access session started before the upgrade was not disconnected at any point during the upgrade.
 * The following logfiles contain no errors:
   - tlsetup.log
   - thinlinc-install.log
   - vsmserver.log
   - vsmagent.log
   - tlwebaccess.log
   - tlwebadm.log
Comment 28 Tobias cendio 2022-04-27 15:35:13 CEST
Verified following points on RHEL8:

 * Services are stopped after running install_server to upgrade from build 2594 to build 2595.
 * Services are started again after completing tl-setup of the 2595 upgrade.
 * A Web Access session started before the upgrade was not disconnected at any point during the upgrade.
 * The following logfiles contain no errors:
   - tlsetup.log
   - thinlinc-install.log
   - vsmserver.log
   - vsmagent.log
   - tlwebaccess.log
   - tlwebadm.log
Comment 30 Samuel Mannehed cendio 2022-04-27 15:40:59 CEST
Also verified the same things on RHEL9:

 * Services are stopped after running install_server to upgrade from build 2594 to build 2595.
 * Services are started again after completing tl-setup of the 2595 upgrade.
 * A Web Access session started before the upgrade was not disconnected at any point during the upgrade.
 * The following logfiles contain no errors (mostly):
   - tlsetup.log ***
   - thinlinc-install.log
   - vsmserver.log
   - vsmagent.log
   - tlwebaccess.log
   - tlwebadm.log

*** There are SELinux issues on RHEL 9, see bug 7823.

The commits made on this bug also look good, and after a minor tweak, so do the release notes. Closing.
Comment 31 Samuel Mannehed cendio 2022-04-27 15:42:27 CEST
Since RHEL 9 isn't released yet, the RHEL 9 Beta was used in the previous comment.

Note You need to log in before you can comment on or make changes to this bug.