13 lines
696 B
Desktop File
13 lines
696 B
Desktop File
[Unit]
|
|
Description=rollcall: keep the local Slurm controller's slurm.conf in sync with the rendered profile
|
|
After=rollcall.service
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
# PROFILE is the profile whose overlay carries slurm.conf
|
|
Environment=PROFILE=compute
|
|
ExecStart=/bin/sh -c 'set -e; new=$(/usr/local/bin/rollcall render "$PROFILE" etc/slurm/slurm.conf) || exit 0; \
|
|
if ! printf "%%s\n" "$new" | grep -v "^# rendered by rollcall" | cmp -s - <(grep -v "^# rendered by rollcall" /etc/slurm/slurm.conf 2>/dev/null); then \
|
|
printf "%%s\n" "$new" > /etc/slurm/slurm.conf.new && mv /etc/slurm/slurm.conf.new /etc/slurm/slurm.conf; \
|
|
systemctl try-restart slurmctld.service; echo "slurm.conf updated"; fi'
|