aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/src/sh.rs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/populate/src/sh.rs')
-rw-r--r--pkgs/populate/src/sh.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/populate/src/sh.rs b/pkgs/populate/src/sh.rs
index 0c200ce..aabf328 100644
--- a/pkgs/populate/src/sh.rs
+++ b/pkgs/populate/src/sh.rs
@@ -190,7 +190,9 @@ fi
/// finish, appends ENTRY to it, prints record and what's in
/// SENTINEL/run.json, the last run's record, if any, and prints locked.
/// Then it keeps the lock until its standard input ends, which consumers
-/// of the target directory can wait for by taking a shared lock. NAME is
+/// of the target directory can wait for by taking a shared lock, and
+/// appends the lines of its input to the journal: the entries no other
+/// command took to the target, e.g. of a run that failed. NAME is
/// the sentinel's name in messages. Writing to a symlink in place of the
/// lock or the journal would write to what it points to, so it refuses
/// those.
@@ -217,7 +219,9 @@ if test -f "$sentinel"/run.json; then
cat "$sentinel"/run.json
fi
echo locked
-exec cat >/dev/null
+while IFS= read -r line; do
+ printf '%s\n' "$line" >> "$sentinel"/journal
+done
"#;
/// record SENTINEL RECORD: writes RECORD to SENTINEL/run.json, replacing
[cgit] Unable to lock slot /tmp/cgit/e0000000.lock: Permission denied (13)