From 7b40db1bad31373a1637c2ffa2c869ebfcd4328b Mon Sep 17 00:00:00 2001 From: Philip Guyton Date: Wed, 26 Jul 2023 18:45:43 +0100 Subject: [PATCH] Clarify in comments our service macros #36 We make use of service macros to administer our systemd services. Clarify via comments to assist in maintenance. --- rockstor.spec | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/rockstor.spec b/rockstor.spec index 400c861..63b2ef5 100644 --- a/rockstor.spec +++ b/rockstor.spec @@ -326,6 +326,9 @@ if [ "$1" = "2" ]; then # update # Remove our prior versions .venv dir as build.sh (posttrans) will regenerate. rm -rf %{prefix}/%{name}/.venv fi +# enable/disable our units by default on package installation, +# enforcing distribution, spin or administrator preset policy. +# See: https://build.opensuse.org/package/show/home:rockstor:branches:Base:System/systemd-presets-branding-rockstor %service_add_post rockstor-pre.service rockstor.service rockstor-bootstrap.service exit 0 @@ -334,6 +337,7 @@ exit 0 # $1 == 0 is before an uninstall # $1 == 1 is before an update # +# If uninstall, the following service macro disables and stops our services. %service_del_preun rockstor-pre.service rockstor.service rockstor-bootstrap.service exit 0 @@ -344,6 +348,7 @@ exit 0 # # During package update, % service_del_postun restarts units. # If units are not to be restarted, % service_del_postun_without_restart should be used instead. +# The following service macro deletes our services, then does a 'systemctl daemon-reload' %service_del_postun_without_restart rockstor-pre.service rockstor.service rockstor-bootstrap.service # We need to restart the nginx service as we removed our nginx override file. if [ "$1" = "0" ]; then # uninstall so clean up build.sh generated files and other dynamic files. @@ -369,13 +374,13 @@ exit 0 %posttrans # From: https://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets -# the posttrans scriptlet is available form rpm version 4.4 onwards. +# the posttrans scriptlet is available from rpm version 4.4 onwards. # # Last scriptlet to execute from old or new package versions. # Executed from new package version during install & upgrade similarly. # # Run build.sh -# 1. Install poerty to system. +# 1. Install Poetry to system. # 2. Use it to populate/refresh .venv. # 3. if no jslibs dir exists: # un-tar rockstor-jslibs.tar.gz @@ -394,8 +399,8 @@ exit 0 # https://github.com/openSUSE/obs-build/blob/master/changelog2spec %changelog * Mon Jul 24 2023 The Rockstor Project - 5.0.1-0 --venv not updating re python version change #2626 @phillxnet --(t) Failure to check for updates in locales other than en_US #2627 @phillxnet +-venv not updating re python version change #2626 @phillxnet +-(t) Failure to check for updates in locales other than en_US #2627 @phillxnet * Fri Jul 21 2023 The Rockstor Project - 5.0.0-0 -WARNING -- RENEWED TESTING PHASE 5.0.0-0 -- (DEVELOPERS ONLY) #2610 @phillxnet -Update specifics of Python version in pyproject.toml etc #2620 @phillxnet