From 5a1d72f62c6330d01131981439bdafd4d819c33054749b46056b413bebe728a9 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Tue, 28 Nov 2023 18:02:52 +0000 Subject: [PATCH 1/2] Accepting request 1129638 from home:eeich:branches:network:cluster - Explicitly create an Obsoletes: entry for each package version that is obsoleted by the present version. These are all published versions of the last two major releases as well as all minor versions of the present release lower than the current one (bsc#1216869 2nd part). This prevents the current version to upgrade a old Slurm version for which no upgrade path exists. OBS-URL: https://build.opensuse.org/request/show/1129638 OBS-URL: https://build.opensuse.org/package/show/network:cluster/slurm?expand=0&rev=279 --- slurm.changes | 11 +++++++++++ slurm.spec | 23 +++++++++++++++++++++-- upgrades | 7 +++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 upgrades diff --git a/slurm.changes b/slurm.changes index 0a57b33..61c90ca 100644 --- a/slurm.changes +++ b/slurm.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Nov 28 14:14:28 UTC 2023 - Egbert Eich + +- Explicitly create an Obsoletes: entry for each package version + that is obsoleted by the present version. These are all published + versions of the last two major releases as well as all minor + versions of the present release lower than the current one + (bsc#1216869 2nd part). + This prevents the current version to upgrade a old Slurm version + for which no upgrade path exists. + ------------------------------------------------------------------- Mon Nov 20 15:29:55 UTC 2023 - Egbert Eich diff --git a/slurm.spec b/slurm.spec index 824e5bf..632196f 100644 --- a/slurm.spec +++ b/slurm.spec @@ -18,6 +18,7 @@ # Check file META in sources: update so_version to (API_CURRENT - API_AGE) %define so_version 39 +# Make sure to update `upgrades` as well! %define ver 23.02.6 %define _ver _23_02 #%%define rc_v 0rc1 @@ -72,9 +73,26 @@ Conflicts: %{*} >= %{ver_m}.99 } %if 0%{?base_ver} > 0 && 0%{?base_ver} < %{lua:x=string.gsub(rpm.expand("%_ver"),"_","");print(x)} %define upgrade 1 %endif +%define upgrade_versions upgrades +%define do_obsoletes() %{lua: + local filename = rpm.expand("%_sourcedir") .. "/" .. rpm.expand("%upgrade_versions") + local version = rpm.expand("%version") + local arg = rpm.expand("%{1}") + local f = io.open(filename ,"r") + local em = false + if f~=nil then + f.close(f) + for line in io.lines(filename) do + if em then print('\\n') else em = true end + print("Obsoletes: " .. arg .. " = " .. line) + end + else + print("Obsoletes: " .. arg .. " < " .. version) + end } + %define upgrade_dep() %{?upgrade: # Provides: %{*} = %{version} -Obsoletes: %{*} < %{version} +%{do_obsoletes %{*}} Conflicts: %{*} } %if 0%{?suse_version} >= 1500 @@ -145,7 +163,8 @@ Group: Productivity/Clustering/Computing URL: https://www.schedmd.com Source: https://download.schedmd.com/slurm/%{pname}-%{dl_ver}.tar.bz2 #Source: https://github.com/SchedMD/slurm/archive/refs/tags/%{pname}-%{dl_ver}.tar.gz -Source1: slurm-rpmlintrc +Source1: %upgrade_versions +Source2: slurm-rpmlintrc Source10: slurmd.xml Source11: slurmctld.xml Source12: slurmdbd.xml diff --git a/upgrades b/upgrades new file mode 100644 index 0000000..55ae78f --- /dev/null +++ b/upgrades @@ -0,0 +1,7 @@ +23.02.5 +23.02.3 +23.02.0 +22.05.10 +22.05.5 +22.05.2 +22.05.0 From bbe01bb79f38c73313a82a2c200212b15954dac911dec329bcd07cf0342d8913 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Thu, 30 Nov 2023 19:27:08 +0000 Subject: [PATCH 2/2] Accepting request 1130096 from home:eeich:branches:network:cluster - Add missing service file for slurmrestd (boo#1217711). OBS-URL: https://build.opensuse.org/request/show/1130096 OBS-URL: https://build.opensuse.org/package/show/network:cluster/slurm?expand=0&rev=280 --- slurm.changes | 5 +++++ slurm.spec | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/slurm.changes b/slurm.changes index 61c90ca..d51419a 100644 --- a/slurm.changes +++ b/slurm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Nov 30 18:52:44 UTC 2023 - Egbert Eich + +- Add missing service file for slurmrestd (boo#1217711). + ------------------------------------------------------------------- Tue Nov 28 14:14:28 UTC 2023 - Egbert Eich diff --git a/slurm.spec b/slurm.spec index 632196f..3c6de37 100644 --- a/slurm.spec +++ b/slurm.spec @@ -681,6 +681,10 @@ install -p -m644 etc/slurmd.service etc/slurmdbd.service etc/slurmctld.service % ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcslurmd ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcslurmdbd ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcslurmctld +%if 0%{?build_slurmrestd} +install -p -m644 etc/slurmrestd.service %{buildroot}%{_unitdir} +ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcslurmrestd +%endif install -d -m 0755 %{buildroot}/%{_tmpfilesdir}/ cat <<-EOF > %{buildroot}/%{_tmpfilesdir}/%{pname}.conf # Create a directory with permissions 0700 owned by user slurm, group slurm @@ -990,6 +994,18 @@ rm -f %{buildroot}%{_libdir}/slurm/rest_auth_*.so %postun node %service_del_postun_without_restart slurmd.service +%pre rest +%service_add_pre slurmrestd.service + +%post rest +%service_add_post slurmrestd.service + +%preun rest +%service_del_preun slurmrestd.service + +%postun rest +%service_add_pre slurmrestd.service + %pre config %{?have_sysuser:-f %{pname}.pre} %if 0%{!?have_sysuser:1} getent group %slurm_g >/dev/null || groupadd -r %slurm_g @@ -1042,6 +1058,9 @@ rm -rf /srv/slurm-testsuite/src /srv/slurm-testsuite/testsuite \ %posttrans slurmdbd %_restart_on_update slurmdbd +%posttrans rest +%_restart_on_update slurmrestd + %if 0%{?sle_version} > 120200 || 0%{?suse_version} > 1320 %define my_license %license %else @@ -1306,6 +1325,8 @@ rm -rf /srv/slurm-testsuite/src /srv/slurm-testsuite/testsuite \ %if 0%{?build_slurmrestd} %files rest %{_sbindir}/slurmrestd +%{_sbindir}/rcslurmrestd +%{_unitdir}/slurmrestd.service %{_mandir}/man8/slurmrestd.* %{_libdir}/slurm/openapi_dbv0_0_39.so %{_libdir}/slurm/openapi_v0_0_39.so