Ticket 2092 - Systemd and spec file tweaks
Summary: Systemd and spec file tweaks
Status: RESOLVED FIXED
Alias: None
Product: Slurm
Classification: Unclassified
Component: Other (show other tickets)
Version: 15.08.2
Hardware: Linux Linux
: 5 - Enhancement
Assignee: David Bigagli
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2015-11-02 12:47 MST by Josko Plazonic
Modified: 2015-11-11 08:42 MST (History)
6 users (show)

See Also:
Site: Princeton (PICSciE)
Alineos Sites: ---
Atos/Eviden Sites: ---
Confidential Site: ---
Coreweave sites: ---
Cray Sites: ---
DS9 clusters: ---
HPCnow Sites: ---
HPE Sites: ---
IBM Sites: ---
NOAA SIte: ---
OCF Sites: ---
Recursion Pharma Sites: ---
SFW Sites: ---
SNIC sites: ---
Linux Distro: ---
Machine Name:
CLE Version:
Version Fixed: 15.08.4
Target Release: ---
DevPrio: ---
Emory-Cloud Sites: ---


Attachments
Systemd/spec file changes (13.60 KB, patch)
2015-11-02 12:47 MST, Josko Plazonic
Details | Diff
Updated patch for 15.08.03 (12.54 KB, patch)
2015-11-04 23:46 MST, Josko Plazonic
Details | Diff
Updated patch against git branch for 15.08 (11.45 KB, patch)
2015-11-05 00:28 MST, Josko Plazonic
Details | Diff

Note You need to log in before you can comment on or make changes to this ticket.
Description Josko Plazonic 2015-11-02 12:47:04 MST
Created attachment 2367 [details]
Systemd/spec file changes

We've started using systemd with slurm in RHEL7 but to do it neatly we had to tweak a few things.  We also have a few other spec file changes that you may want to consider:

Spec file changes:
- best to use %{version} in Source and %setup (not that -n %{version} is necessary at all for %setup, not the way you have it)
- various rpm subrpms should match version-wise
- best to specify various dependencies - of course this is specific to rhel6/7 - not sure how many use this spec file on Suse, there is sure to be different.  Without this it doesn't build in mock.
- rpm should own support dirs (/var/spool/slurmd and friends)
- logrotate support
- where did useradd/group go for slurm? we sure want it

Systemd:
- we like having /etc/sysconfig options, just in case
- it is best to let systemd know how to reload appropriate daemon (so systemctl reload slurmd/systemctl/... works)
- spec file should install only systemd files on rhel7 and treat them accordingly
- similarly systemd aware support for logrotate
- we also like lifting default limits for slurmd, though not entirely sure that is required.
Comment 1 Martins Innus 2015-11-04 07:16:28 MST
This would be great.  I haven't looked at all the details of this patch, but we do similar things for the systemd files, logrotate, and limits.
Comment 2 David Bigagli 2015-11-04 20:05:39 MST
Hi,
  the patch does not apply against latest 15.08.3 I tried older version
but have the same problem:

 $ git apply --check slurm-systemdtweaks.patch 
error: patch failed: etc/slurmd.service.in:5
error: etc/slurmd.service.in: patch does not apply
error: patch failed: slurm.spec:93
error: slurm.spec: patch does not apply

could you regenerate the diffs against the latest commit
55c4de24e17a91ec249ba43?

Thanks,
David
Comment 3 Josko Plazonic 2015-11-04 23:46:22 MST
Created attachment 2390 [details]
Updated patch for 15.08.03
Comment 4 David Bigagli 2015-11-05 00:15:50 MST
Thanks for the new patch. I had to use 'patch' to apply parts of it
as 'git apply' refuses to apply only parts of a patch. The spec.file still
gives some errors.

patching file etc/slurmdbd.service.in
patching file etc/slurmd.service.in
patching file slurm.spec
Hunk #1 FAILED at 93.
Hunk #18 FAILED at 425.
Hunk #21 FAILED at 637.
3 out of 30 hunks FAILED -- saving rejects to file slurm.spec.rej

I have committed only the first 3 parts.

commit d05f6994834d9a468a7f53837068f4832538297e
Author: Josko Plazonic <plazonic@princeton.edu>
Date:   Thu Nov 5 15:12:24 2015 +0100

    Improve the systemd startup files.

I think this is ok for now as I need to see what Support things of the
spec file patch which introduces new things like support for logrotate
which is an external software not released with Slurm.

David
Comment 5 Josko Plazonic 2015-11-05 00:28:32 MST
Created attachment 2391 [details]
Updated patch against git branch for 15.08

Original patch was against 15.08.3 tarball - rebased it to git. I promise to next time try doing it the right way (i.e. going through github...).

As far as logrotate - it's a pretty standard thing to have...  If not present it just won't do anything but any RHEL/Fedora release has it and I am pretty sure every other rpm based distro does too.
Comment 6 David Bigagli 2015-11-05 00:34:50 MST
No worries. :-) 

Yes logrotate is pretty standard indeed, we recommended people using it,
but I still have to synchronize with Support.

David
Comment 7 David Bigagli 2015-11-05 20:24:51 MST
For the spec file we have a opened a ticket #2061 to restructure the current
rpms. We will commit your patch for the spec file under that problem.

Najljepša hvala,
                David
Comment 8 Josko Plazonic 2015-11-06 00:07:30 MST
Grazie, but I have no access to #2061 :(
Comment 9 David Bigagli 2015-11-06 00:45:19 MST
2061 is actually empty, it it a placeholder for the rpm work. I will see 
if we can add you in cc since
you have submitted the valuable patch.

On 11/06/2015 03:07 PM, bugs@schedmd.com wrote:
>
> *Comment # 8 <http://bugs.schedmd.com/show_bug.cgi?id=2092#c8> on bug 
> 2092 <http://bugs.schedmd.com/show_bug.cgi?id=2092> from Josko 
> Plazonic <mailto:plazonic@princeton.edu> *
> Grazie, but I have no access to #2061 :(
> ------------------------------------------------------------------------
> You are receiving this mail because:
>
>   * You are on the CC list for the bug.
>   * You are the assignee for the bug.
>   * You are watching someone on the CC list of the bug.
>   * You are watching the assignee of the bug.
>