aboutsummaryrefslogtreecommitdiff
path: root/guix-container.sh
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-11-21 21:26:01 +0100
committerWojtek Kosior <koszko@koszko.org>2022-11-21 21:48:21 +0100
commitd9e2c6ca4b22257820028df3adcd9bd290c12e24 (patch)
treeed7be4d4a941d4709ef0c279033576f44957b61f /guix-container.sh
parent76090eb283086b06aa57375be965a9e03686a08e (diff)
downloadkoszko-org-server-d9e2c6ca4b22257820028df3adcd9bd290c12e24.tar.gz
koszko-org-server-d9e2c6ca4b22257820028df3adcd9bd290c12e24.zip
make container write logs to a directory shared with host
Diffstat (limited to 'guix-container.sh')
-rwxr-xr-xguix-container.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/guix-container.sh b/guix-container.sh
index 2430d8a..9218a54 100755
--- a/guix-container.sh
+++ b/guix-container.sh
@@ -81,14 +81,17 @@ onexit() {
start() {
KOSZKO_SIDELOAD_REAL=/var/www/koszko.org/html
KOSZKO_SIDELOAD_INSIDE=/srv/http/koszko.org
+ LOG_REAL="$LOG_DIR"/container
+ LOG_INSIDE=/var/log
HTTP_DIR_SHARE_OPT=--share="$KOSZKO_SIDELOAD_REAL"="$KOSZKO_SIDELOAD_INSIDE"
+ LOG_DIR_SHARE_OPT=--share="$LOG_REAL"="$LOG_INSIDE"
mkdir -p "$(dirname "$LOG_DIR")"
mkdir --mode=700 -p "$LOG_DIR"
+ mkdir --mode=700 -p "$LOG_DIR"/container
- "$EXECUTABLE" $HTTP_DIR_SHARE_OPT \
- >> "$LOG_DIR"/stdout.log \
- 2>> "$LOG_DIR"/stderr.log &
+ "$EXECUTABLE" "$HTTP_DIR_SHARE_OPT" "$LOG_DIR_SHARE_OPT" \
+ >> "$LOG_DIR"/stdout.log 2>> "$LOG_DIR"/stderr.log &
GUILE_PID=$!
WAIT_TIME=0