Skip to content

Commit

Permalink
Fix slurm email
Browse files Browse the repository at this point in the history
By default slurm excepts `mail` to be installed. Since 5181add,
mail has been replaced by postfix and the binary `sendmail`.
mail and sendmail do not share the same flags, so this commit
introduces a wrapper named `slurm_mail` that takes arguments
from Slurm and convert the ones needed in something
sendmail can understand.

Fix #144
  • Loading branch information
cmd-ntrf committed Sep 28, 2021
1 parent 27b40d9 commit be94397
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions site/profile/files/slurm/slurm_mail
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

email=${@: -1}
subject=${@: 2:$#-2}
cat << EOF | /usr/sbin/sendmail $email
To: ${email}
Subject: ${subject}
EOF
6 changes: 6 additions & 0 deletions site/profile/manifests/slurm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@
contain profile::slurm::base
include profile::mail::server

file { '/usr/sbin/slurm_mail':
ensure => 'present',
source => 'puppet:///modules/profile/slurm/slurm_mail',
mode => '0755',
}

consul::service { 'slurmctld':
port => 6817,
require => Tcp_conn_validator['consul'],
Expand Down
1 change: 1 addition & 0 deletions site/profile/templates/slurm/slurm.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ MpiDefault=pmi2
ProctrackType=proctrack/cgroup
TaskPlugin=task/cgroup
PropagateResourceLimits=NONE
MailProg=/usr/sbin/slurm_mail

StateSaveLocation=/var/spool/slurm
<% if $slurm_version == '19.05' { -%>
Expand Down

0 comments on commit be94397

Please sign in to comment.