Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Web-UI update re systemd service management #2651

Closed
phillxnet opened this issue Aug 14, 2023 · 2 comments
Closed

Improve Web-UI update re systemd service management #2651

phillxnet opened this issue Aug 14, 2023 · 2 comments
Assignees

Comments

@phillxnet
Copy link
Member

phillxnet commented Aug 14, 2023

The Web-UI update mechanism, by virtue of our existing architecture, involves us changing the legs we run on. To approach this we hand-off the update process to AT, an OS level scheduler, that we use to run a simple script. During recent investigations info a Leap 15.5 failure to Web-UI update it has come to light that we do not actually stop our services as intended: prior to our initiating a package update. There are no user visible ramifications to this internal failure but root is emailed as follows:

Message  2:
From root@localhost  Mon Aug 14 15:40:16 2023
X-Original-To: root
Delivered-To: root@localhost
Subject: Output from your job       10
To: root@localhost
Date: Mon, 14 Aug 2023 15:40:16 +0100 (WEST)
From: root <root@localhost>

Failed to stop rockstor-jslibs.tar.gz.service: Unit rockstor-jslibs.tar.gz.service not loaded.
Failed to stop rockstor-jslibs.tar.gz.sha256sum.service: Unit rockstor-jslibs.tar.gz.sha256sum.service not loaded.
Failed to stop rockstor-tasks-huey.db.service: Unit rockstor-tasks-huey.db.service not loaded.
Failed to stop rockstor-tasks-huey.db-shm.service: Unit rockstor-tasks-huey.db-shm.service not loaded.
Failed to stop rockstor-tasks-huey.db-wal.service: Unit rockstor-tasks-huey.db-wal.service not loaded.
Repository 'Buildbot-Testing' is up to date.
Repository 'Local-Repository' is up to date.
Repository 'Rockstor-Testing' is up to date.
Repository 'home_rockstor' is up to date.
Repository 'home_rockstor_branches_Base_System' is up to date.
Repository 'Update repository of openSUSE Backports' is up to date.
Repository 'Non-OSS Repository' is up to date.
Repository 'Open H.264 Codec (openSUSE Leap)' is up to date.
Repository 'Main Repository' is up to date.
Repository 'Update repository with updates from SUSE Linux Enterprise 15' is up to date.
Repository 'Main Update Repository' is up to date.
Repository 'Update Repository (Non-Oss)' is up to date.
All repositories have been refreshed.
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following package is going to be upgraded:
  rockstor

1 package to upgrade.
Overall download size: 2.3 MiB. Already cached: 0 B. After the operation, additional 17.6 KiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving: rockstor-5.0.2-2648.x86_64 (Local-Repository) (1/1),   2.3 MiB

and the intended rockstor package update is accomplished.

The programmatically generated update script in question is currently akin to:

sleep 10
/usr/bin/systemctl stop rockstor*
/usr/bin/find /opt/rockstor/ -name "*.pyc" -not -path "*/eggs/*" -type f -delete
/usr/bin/zypper --non-interactive refresh
/usr/bin/zypper --non-interactive install rockstor
/usr/bin/systemctl start rockstor-bootstrap
rm /tmp/own-filename-here

and is executed with PWD=/opt/rockstor which is, in part, the reasons for the observed "Failed to stop ..." errors/entries in the root users email.

It is proposed that we instead remove the currently non functional /usr/bin/systemctl stop rockstor* line and either replace it with specifically named services, or likely more appropriately, replace it with an issue in https://github.com/rockstor/rockstor-rpmbuild where we ensure services are first stopped during an upgrade: which they appear not to be.

@phillxnet
Copy link
Member Author

An further example of our failure in the following line of our AT executed update script:

/usr/bin/systemctl stop rockstor*

due to our use of a wild card and intended pwd; is detailed in the following testing comment for a prior related pull reques (now merged): #2654 (comment)

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Aug 15, 2023
- Remove dysfunctional and out-of-place systemd stop command.
- Remove out-of-place Python bytecode (*.pyc) file deletion mechanism.

Both of the above update elements would be more appropriately
managed by zypper/rpm. With the latter having dubious utility;
and potentially negative ramifications.
phillxnet added a commit that referenced this issue Aug 17, 2023
…-systemd-service-management

Improve Web-UI update re systemd service management #2651
@phillxnet
Copy link
Member Author

Closing as:
Fixed by #2656

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant