Skip to content

Commit edaf539

Browse files
entrypoints: dereference symlinks when copying sssd config (cp -rL)
The sssd config now arrives as a k8s Secret volume, where files are symlinks into the ..data directory. cp -r copied the symlink itself, leaving /etc/sssd/sssd.conf dangling and sssd starting with no domains. cp -rL copies the file content. (The munge key copy is unaffected: plain cp already dereferences its source.) Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a8b9aa4 commit edaf539

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

slurmctld/entrypoint.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ fi
6464
# =============================================================================
6565
# SSSD SETUP - Standardized across Slurm services that require it
6666
# =============================================================================
67-
# The real sssd.conf is mounted read-only at /etc/sssd/.secret/ and copied
67+
# The real sssd.conf is mounted read-only at /etc/sssd/.secret/ (a k8s Secret)
68+
# and copied with -L to dereference the secret volume symlinks, because sssd
6869
# into place because sssd requires 0600 root-owned config, which a k8s
6970
# volume mount cannot guarantee by itself.
7071

7172
if [ -f /etc/sssd/.secret/sssd.conf ]; then
72-
cp -r /etc/sssd/.secret/* /etc/sssd
73+
cp -rL /etc/sssd/.secret/* /etc/sssd
7374
chmod 700 /etc/sssd
7475
chmod 600 /etc/sssd/sssd.conf
7576
chown root:root /etc/sssd /etc/sssd/sssd.conf

slurmrestd/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mkdir -p /var/log/slurm /var/run/slurm
3838
# does run sssd). If the mount is added later this block picks it up.
3939

4040
if [ -f /etc/sssd/.secret/sssd.conf ]; then
41-
cp -r /etc/sssd/.secret/* /etc/sssd
41+
cp -rL /etc/sssd/.secret/* /etc/sssd
4242
chmod 700 /etc/sssd
4343
chmod 600 /etc/sssd/sssd.conf
4444
chown root:root /etc/sssd /etc/sssd/sssd.conf

0 commit comments

Comments
 (0)