summaryrefslogtreecommitdiffstats
path: root/krops.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-01 03:26:27 +0000
committertv <tv@krebsco.de>2026-12-01 03:26:27 +0000
commitef08ae0524371530d6967e9e715652b93c02cb33 (patch)
treec5a303f2986350f776fdcb06201d123a9a6f267d /krops.nix
parent8304ba70fc911058364df7f6ac5d89dd29ba8158 (diff)
krops.nix: put enstate submissions in place in one step
From /run to /var/lib/enstate, mv copies, so a submission was briefly half there in the incoming directory. Now each is copied under a dot name, which enstate skips, and renamed.
Diffstat (limited to 'krops.nix')
-rw-r--r--krops.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/krops.nix b/krops.nix
index 88f8eee8..aa4e511d 100644
--- a/krops.nix
+++ b/krops.nix
@@ -203,9 +203,15 @@ rec {
forgetPending = /* sh */ ''
trap 'rm -fR ${pending}' EXIT
'';
+ # Copied under a dot name, which enstate skips, and renamed: from memory
+ # to disk, mv would copy, and enstate could see half a submission.
movePending = /* sh */ ''
mkdir -p -m 0700 ${stateDir} ${stateDir}/incoming
- find ${pending} -mindepth 1 -maxdepth 1 -exec mv -t ${stateDir}/incoming {} +
+ find ${pending} -mindepth 1 -maxdepth 1 -printf '%f\n' |
+ while read -r submission; do
+ cp -a ${pending}/"$submission" ${stateDir}/incoming/."$submission"
+ mv ${stateDir}/incoming/."$submission" ${stateDir}/incoming/"$submission"
+ done
'';
};
[cgit] Unable to lock slot /tmp/cgit/c6100000.lock: Permission denied (13)