Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBryan Drewery <bryan@shatow.net>2017-03-12 01:52:06 +0300
committerBryan Drewery <bryan@shatow.net>2017-03-12 02:31:51 +0300
commita788d6d4f4cbb9b128b98f1f797920addea08301 (patch)
treee6af84c6c40c0152b9eb825ff7c413796f4698c7 /src
parent937e4ca00ddcda1608ec027cae3f8a9644a32e4d (diff)
HTML JSON: Build these in a critical section.
This delayed INT/TERM until done. This is addressing two issues: 1. We use mktemp() inside of the logdir to make the next mv atomic, which can leave behind a tmpfile if killed during this. A simple TERM or the html_json_cleanup could handle fixing this, but it ignores problem #2. 2. We want the interface data to be as consistent as possible. It would not be idle to have updated the jail JSON but not the top level JSON.
Diffstat (limited to 'src')
-rw-r--r--src/share/poudriere/include/html.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/share/poudriere/include/html.sh b/src/share/poudriere/include/html.sh
index 98f4bed1..ce5e4642 100644
--- a/src/share/poudriere/include/html.sh
+++ b/src/share/poudriere/include/html.sh
@@ -59,9 +59,11 @@ html_json_main() {
}
build_all_json() {
+ critical_start
build_json
build_jail_json
build_top_json
+ critical_end
}
build_json() {
@@ -89,7 +91,6 @@ build_jail_json() {
_log_path_jail log_path_jail
tmpfile=$(TMPDIR="${log_path_jail}" mktemp -ut json)
-
{
echo "{\"builds\":{"
echo ${log_path_jail}/*/.data.mini.json | \
@@ -106,7 +107,6 @@ build_top_json() {
_log_path_top log_path_top
tmpfile=$(TMPDIR="${log_path_top}" mktemp -ut json)
-
(
cd "${log_path_top}"
echo "{\"masternames\":{"