Skip to content

Commit a50f5ec

Browse files
committed
munge: ensure use consistent template
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
1 parent ef8be5e commit a50f5ec

4 files changed

Lines changed: 21 additions & 9 deletions

File tree

controllers/slurm/templates/components.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,20 @@ mkdir -p ${workdir}
2929
{{define "exit"}}
3030
sleep infinity
3131
{{ if .Spec.Interactive }}sleep infinity{{ end }}
32-
{{ end }}
32+
{{ end }}
33+
34+
{{ define "munge"}}
35+
echo "---> Starting the MUNGE Authentication service (munged) ..."
36+
37+
# Create the missing directory
38+
mkdir -p /run/munge
39+
40+
# Set ownership so the munge user can write the socket
41+
chown -R munge:munge /run/munge
42+
43+
# Start the daemon manually
44+
gosu munge /usr/sbin/munged --force
45+
46+
# Verify it works
47+
munge -n | unmunge
48+
{{end}}

controllers/slurm/templates/daemon.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ echo "Hello, I am a worker with $(hostname)"
55
# Shared logic to install hq
66
{{template "init" .}}
77

8-
echo "---> Starting the MUNGE Authentication service (munged) ..."
9-
gosu munge /usr/sbin/munged
8+
{{template "munge" .}}
109

1110
echo "---> Starting the Slurm Database Daemon (slurmdbd) ..."
1211

controllers/slurm/templates/server.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ echo "Hello, I am a server with $(hostname)"
55
# This script handles shared start logic
66
{{template "init" .}}
77

8-
# Default entrypoint with slurmctld, this is like a login node
9-
echo "---> Starting the MUNGE Authentication service (munged) ..."
10-
gosu munge /usr/sbin/munged
8+
{{template "munge" .}}
119

1210
echo "---> Sleeping for slurmdbd to become active before starting slurmctld ..."
1311

controllers/slurm/templates/worker.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
echo "Hello, I am a worker with $(hostname)"
44

5-
# Shared logic to install hq
5+
# Shared logic
66
{{template "init" .}}
77

88
# This is a worker node
9-
echo "---> Starting the MUNGE Authentication service (munged) ..."
10-
gosu munge /usr/sbin/munged
9+
{{ template "munge" .}}
1110

1211
echo "---> Waiting for slurmctld to become active before starting slurmd..."
1312
sleep 30

0 commit comments

Comments
 (0)