From a47a9ab6d8e66f82c50b41e0c6150fd781d6b7cde081bed6b7696e94f16fbf30 Mon Sep 17 00:00:00 2001 From: Corot Sebastien Date: Sat, 11 Feb 2017 20:31:48 +0000 Subject: [PATCH] Accepting request 455364 from home:eeich:branches:network:cluster - Use %slurm_u and %slurm_g macros defined at the beginning of the spec file when adding the slurm user/group for consistency. - Define these macros to daemon,root for non-systemd. - For anything newer than Leap 42.1 or SLE-12-SP1 build OpenHPC compatible. OBS-URL: https://build.opensuse.org/request/show/455364 OBS-URL: https://build.opensuse.org/package/show/network:cluster/slurm?expand=0&rev=14 --- slurm.changes | 8 ++++++++ slurm.spec | 28 +++++++++++++++++++--------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/slurm.changes b/slurm.changes index 39c7f92..ac97c35 100644 --- a/slurm.changes +++ b/slurm.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Feb 7 16:47:17 UTC 2017 - eich@suse.com + +- Use %slurm_u and %slurm_g macros defined at the beginning of the spec + file when adding the slurm user/group for consistency. +- Define these macros to daemon,root for non-systemd. +- For anything newer than Leap 42.1 or SLE-12-SP1 build OpenHPC compatible. + ------------------------------------------------------------------- Wed Feb 1 20:17:47 UTC 2017 - eich@suse.com diff --git a/slurm.spec b/slurm.spec index 358cc69..52add43 100644 --- a/slurm.spec +++ b/slurm.spec @@ -15,10 +15,10 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -%define trans() ( echo %{1} | sed -e "s#-#\\.#g" ) -%define trunc() ( echo %{1} | sed -e "s#\\([^.]\\+\\.[^.]\\+\\.[^.]\\+\\).*#\\1#" ) -%define vers_f() %(%trans) -%define vers_t() %(%trunc) +# For anything newer than Leap 42.1 and SLE-12-SP1 build compatible to OpenHPC. +%if 0%{?sle_version} >= 120200 +%define OHPC_BUILD 1 +%endif %if 0%{?suse_version} >= 1220 || 0%{?sle_version} >= 120000 %define with_systemd 1 @@ -41,8 +41,18 @@ %define libslurm libslurm29 %define ver_exp 16-05-8-1 -%define slurm_u %name -%define slurm_g %name +%if 0%{?with_systemd} + %define slurm_u %name + %define slurm_g %name +%else + %define slurm_u daemon + %define slurm_g root +%endif + +%define trans() ( echo %{1} | sed -e "s#-#\\.#g" ) +%define trunc() ( echo %{1} | sed -e "s#\\([^.]\\+\\.[^.]\\+\\.[^.]\\+\\).*#\\1#" ) +%define vers_f() %(%trans) +%define vers_t() %(%trunc) Name: slurm Version: %{vers_f %ver_exp} @@ -414,8 +424,8 @@ EOF %endif %define slurmdir %{_sysconfdir}/slurm %define slurmdescr "SLURM workload manager" -getent group %name >/dev/null || groupadd -r %name -getent passwd %name >/dev/null || useradd -r -g %name -d %slurmdir -s /bin/false -c %{slurmdescr} %name +getent group %slurm_g >/dev/null || groupadd -r %slurm_g +getent passwd %slurm_u >/dev/null || useradd -r -g %slurm_g -d %slurmdir -s /bin/false -c %{slurmdescr} %slurm_u exit 0 %post @@ -499,7 +509,7 @@ exit 0 %{_bindir}/sshare %{_bindir}/sstat %{_bindir}/strigger -%{?have_netloc: %{_bindir}/netloc_to_topology} +%{?have_netloc:%{_bindir}/netloc_to_topology} %{_sbindir}/slurmctld %{_sbindir}/slurmd %{_sbindir}/slurmstepd