From dba73bc89ff623a0855d46f0abb92d7575e76080 Mon Sep 17 00:00:00 2001 From: Gerrit Gogel Date: Sun, 24 Jan 2021 16:01:09 +0100 Subject: [PATCH 1/5] dial down socat verbose output --- seafile-server/scripts/start.sh | 2 +- seahub/scripts/start.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/seafile-server/scripts/start.sh b/seafile-server/scripts/start.sh index e285992..ed38185 100644 --- a/seafile-server/scripts/start.sh +++ b/seafile-server/scripts/start.sh @@ -9,4 +9,4 @@ while [ ! -S /opt/seafile/seafile-server-latest/runtime/seafile.sock ]; do sleep 1 done -socat -v -d -d -d TCP-LISTEN:8001,fork,reuseaddr UNIX:/opt/seafile/seafile-server-latest/runtime/seafile.sock,forever,keepalive \ No newline at end of file +socat -d -d TCP-LISTEN:8001,fork,reuseaddr UNIX:/opt/seafile/seafile-server-latest/runtime/seafile.sock,forever,keepalive \ No newline at end of file diff --git a/seahub/scripts/start.sh b/seahub/scripts/start.sh index 2b53a67..620c45c 100644 --- a/seahub/scripts/start.sh +++ b/seahub/scripts/start.sh @@ -3,7 +3,7 @@ /scripts/create_data_links.sh mkdir -p /opt/seafile/seafile-server-latest/runtime -socat -v -d -d -d UNIX-LISTEN:/opt/seafile/seafile-server-latest/runtime/seafile.sock,fork TCP:seafile-server:8001,forever,keepalive & +socat -d -d UNIX-LISTEN:/opt/seafile/seafile-server-latest/runtime/seafile.sock,fork TCP:seafile-server:8001,forever,keepalive & python3 /opt/seafile/seafile-server-latest/seahub/manage.py runserver 0.0.0.0:8000 From f131b8e3f65e77bd25c905e4b37bf3077de71b2f Mon Sep 17 00:00:00 2001 From: Gerrit Gogel Date: Sun, 24 Jan 2021 16:01:43 +0100 Subject: [PATCH 2/5] seahub: remove log links --- seahub/scripts/create_data_links.sh | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/seahub/scripts/create_data_links.sh b/seahub/scripts/create_data_links.sh index 464ad33..04ff77a 100644 --- a/seahub/scripts/create_data_links.sh +++ b/seahub/scripts/create_data_links.sh @@ -33,15 +33,3 @@ for d in ${dirs[*]}; do rm -rf /opt/seafile/$d && ln -sf $src /opt/seafile fi done - -if [[ -e /shared/logs/seafile ]]; then - mv /shared/logs/seafile /shared/seafile/logs - rm -rf /opt/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/ -else - mkdir -p /shared/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/ -fi - -if [[ ! -e /shared/logs/var-log ]]; then - mkdir -p /shared/logs/ && mv /var/log /shared/logs/var-log -fi -rm -rf /var/log && ln -sf /shared/logs/var-log /var/log From 2792af631122da6c56e649e95fbd050155586053 Mon Sep 17 00:00:00 2001 From: Gerrit Gogel Date: Sun, 24 Jan 2021 16:02:17 +0100 Subject: [PATCH 3/5] seafile-server: remove log links, remove old log folders on startup --- seafile-server/scripts/create_data_links.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/seafile-server/scripts/create_data_links.sh b/seafile-server/scripts/create_data_links.sh index 464ad33..1346dd3 100644 --- a/seafile-server/scripts/create_data_links.sh +++ b/seafile-server/scripts/create_data_links.sh @@ -35,13 +35,11 @@ for d in ${dirs[*]}; do done if [[ -e /shared/logs/seafile ]]; then - mv /shared/logs/seafile /shared/seafile/logs - rm -rf /opt/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/ -else - mkdir -p /shared/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/ + rm -rf /shared/logs/seafile /shared/seafile/logs fi - -if [[ ! -e /shared/logs/var-log ]]; then - mkdir -p /shared/logs/ && mv /var/log /shared/logs/var-log +if [[ -e /shared/seafile/logs ]]; then + rm -rf /shared/seafile/logs +fi +if [[ -e /shared/logs/var-log ]]; then + rm -rf /shared/logs/var-log fi -rm -rf /var/log && ln -sf /shared/logs/var-log /var/log From 48263df05f6bcfc80fb7172ff5cb911eb65f2ea0 Mon Sep 17 00:00:00 2001 From: Gerrit Gogel Date: Sun, 24 Jan 2021 16:02:37 +0100 Subject: [PATCH 4/5] send seahub.log to /dev/stdout --- seahub/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/seahub/Dockerfile b/seahub/Dockerfile index f8da90c..8d3b7c5 100644 --- a/seahub/Dockerfile +++ b/seahub/Dockerfile @@ -79,6 +79,9 @@ ENV SEAFILE_CONF_DIR=/opt/seafile/seafile-data ENV SEAFILE_CENTRAL_CONF_DIR=/opt/seafile/conf ENV SEAFILE_RPC_PIPE_PATH=/opt/seafile/seafile-server-latest/runtime +RUN mkdir -p /opt/seafile/logs &&\ +ln -sf /dev/stdout /opt/seafile/logs/seahub.log + EXPOSE 8000 CMD ["/scripts/start.sh"] \ No newline at end of file From 8c092f9eddfe2a2d6f83d0ef53984104554226e6 Mon Sep 17 00:00:00 2001 From: Gerrit Gogel Date: Sun, 24 Jan 2021 16:03:01 +0100 Subject: [PATCH 5/5] send seafile.log, controller.log and ccnet.log to /dev/stdout --- seafile-server/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/seafile-server/Dockerfile b/seafile-server/Dockerfile index 6876527..6cc548a 100644 --- a/seafile-server/Dockerfile +++ b/seafile-server/Dockerfile @@ -31,6 +31,11 @@ COPY scripts /scripts RUN chmod u+x /scripts/* COPY --from=get /tmp/seafile-server-${SEAFILE_VERSION} /opt/seafile/seafile-server-${SEAFILE_VERSION} +RUN mkdir -p /opt/seafile/logs &&\ +ln -sf /dev/stdout /opt/seafile/logs/seafile.log &&\ +ln -sf /dev/stdout /opt/seafile/logs/controller.log &&\ +ln -sf /dev/stdout /opt/seafile/logs/ccnet.log + EXPOSE 8080 8082 8001 CMD ["/scripts/start.sh"]