Make sure that pdiGcDaemon is the right pid

Move its definition before a loop that might change `$!`
This commit is contained in:
Théophane Hufschmitt 2024-01-26 16:49:07 +01:00 committed by Théophane Hufschmitt
parent e859565a20
commit 1dbba94244

View File

@ -163,11 +163,11 @@ startGcDaemon() {
-s "$NIX_STORE_DIR" \
> /dev/null 2>&1 \
&
pidGcDaemon=$!
for ((i = 0; i < 30; i++)); do
if [[ -S $NIX_GC_SOCKET_PATH ]]; then break; fi
sleep 1
done
pidGcDaemon=$!
trapFunctions[killGcDaemon]=killGcDaemon
}