From 3e7060069171574d416a58ce5a1fd6cd9dc1e4d4 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 28 Oct 2023 09:52:24 -0500 Subject: [PATCH] r/samba-dc: sysvolsync: Fix running on fresh DC On a new DC, the `idmap.ldb` file does not yet exist the first time `sysvolsync` runs. This causes a syntax error in the condition that checks the modification timestamp of the file. --- roles/samba-dc/files/sysvolsync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/samba-dc/files/sysvolsync.sh b/roles/samba-dc/files/sysvolsync.sh index 6575e08..4fd91e3 100644 --- a/roles/samba-dc/files/sysvolsync.sh +++ b/roles/samba-dc/files/sysvolsync.sh @@ -64,7 +64,7 @@ debug "Copying idmap.ldb from ${pdc}" rsync -a${DEBUG+i} --delete "${pdc}:${IDMAP_LDB}.bak" "${IDMAP_LDB}.new" st_new=$(stat -c %Y "${IDMAP_LDB}.new") st_cur=$(stat -c %Y "${IDMAP_LDB}") -if [ "${st_new}" -ne "${st_cur}" ]; then +if [ -z "${st_cur}" ] || [ "${st_new}" != "${st_cur}" ]; then info "Got updated idmap.ldb from ${pdc}" info 'Stopping Samba service' systemctl stop samba || exit