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
This commit is contained in:
Corot Sebastien 2017-02-11 20:31:48 +00:00 committed by Git OBS Bridge
parent bd06e0c765
commit a47a9ab6d8
2 changed files with 27 additions and 9 deletions

View File

@ -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

View File

@ -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