controller sync as a POSIX script (the unit's inline shell used bash-only syntax)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
c81b498df1
commit
1452b79218
3 files changed
+19
-4
No files matched your search
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
# Render the profile's slurm.conf and, when it differs from the local one,
|
||||
# install it and restart slurmctld. Runs from rollcall-controller-sync.timer.
|
||||
set -eu
|
||||
PROFILE=${PROFILE:-compute}
|
||||
CONF=/etc/slurm/slurm.conf
|
||||
new=$(mktemp)
|
||||
trap 'rm -f "$new"' EXIT
|
||||
/usr/local/bin/rollcall render "$PROFILE" etc/slurm/slurm.conf > "$new" || exit 0
|
||||
if [ -f "$CONF" ] && grep -v '^# rendered by rollcall' "$new" | cmp -s - "$(grep -v '^# rendered by rollcall' "$CONF" > "$new.old" && echo "$new.old")"; then
|
||||
rm -f "$new.old"
|
||||
exit 0
|
||||
fi
|
||||
rm -f "$new.old"
|
||||
install -m 0644 "$new" "$CONF"
|
||||
systemctl try-restart slurmctld.service
|
||||
echo "slurm.conf updated"
|
||||
Reference in new issue
Block a user