- Fix user/group settings (boo#1084333)

* Fix user/group for /var/run/slurm the PID file directory.
  * Fix user/group in systemd service files for process ownership.

OBS-URL: https://build.opensuse.org/package/show/network:cluster/slurm?expand=0&rev=41
This commit is contained in:
Egbert Eich 2018-03-07 15:28:17 +00:00 committed by Git OBS Bridge
parent 9c6e84b74f
commit a59a0c2ced
2 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Mar 7 14:20:06 UTC 2018 - eich@suse.com
- Fix user/group settings (boo#1084333)
* Fix user/group for /var/run/slurm the PID file directory.
* Fix user/group in systemd service files for process ownership.
-------------------------------------------------------------------
Mon Jan 29 13:43:57 UTC 2018 - cgoll@suse.com

View File

@ -335,13 +335,24 @@ make install-contrib DESTDIR=%{buildroot} PERL_MM_PARAMS="INSTALLDIRS=vendor"
%if 0%{?with_systemd}
mkdir -p %{buildroot}%{_unitdir}
install -p -m644 etc/slurmd.service etc/slurmdbd.service etc/slurmctld.service %{buildroot}%{_unitdir}
# Fix up User/Group of slurmd/slurmctld service.
for i in slurmd.service slurmctld.service;
do
grep -Eq "^Group=" %{buildroot}%{_unitdir}/$i && \
sed-i -e "s/Group=.*/User=%slurm_g/" %{buildroot}%{_unitdir}/$i || \
sed -i -e "/\[Service\]/aGroup=%slurm_g" %{buildroot}%{_unitdir}/$i
grep -Eq "^User=" %{buildroot}%{_unitdir}/$i && \
sed -i -e "s/User=.*/User=%slurm_u/" %{buildroot}%{_unitdir}/$i || \
sed -i -e "/\[Service\]/aUser=%slurm_u" %{buildroot}%{_unitdir}/$i
done
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcslurmd
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcslurmdbd
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcslurmctld
install -d -m 0755 %{buildroot}/%{_tmpfilesdir}/
cat <<-EOF > %{buildroot}/%{_tmpfilesdir}/%{name}.conf
# Create a directory with permissions 0700 owned by user slurm, group slurm
d /var/run/slurm 0700 slurm slurm
d /var/run/slurm 0700 %slurm_u %slurm_g
EOF
chmod 0644 %{buildroot}/%{_tmpfilesdir}/%{name}.conf
%else