Преглед на файлове

[hotfix] produce version 2.5.1 with fixes for log rotation

Jakob Ackermann преди 5 години
родител
ревизия
1d8ed4bb23
променени са 3 файла, в които са добавени 31 реда и са изтрити 0 реда
  1. 13 0
      server-ce/hotfix/2.5.1/Dockerfile
  2. 8 0
      server-ce/hotfix/2.5.1/contacts-run.patch
  3. 10 0
      server-ce/hotfix/2.5.1/delete-old-logs.patch

+ 13 - 0
server-ce/hotfix/2.5.1/Dockerfile

@@ -0,0 +1,13 @@
+FROM sharelatex/sharelatex:2.5.0
+
+# Patch #826: Fixes log path for contacts service to be picked up by logrotate
+COPY contacts-run.patch /etc/service/contacts-sharelatex
+RUN cd /etc/service/contacts-sharelatex && patch < contacts-run.patch
+
+# Patch #826: delete old logs for the contacts service
+COPY delete-old-logs.patch /etc/my_init.d
+RUN cd /etc/my_init.d && patch < delete-old-logs.patch \
+&&  chmod +x /etc/my_init.d/10_delete_old_logs.sh
+
+# Patch #827: fix logrotate file permissions
+RUN chmod 644 /etc/logrotate.d/sharelatex

+ 8 - 0
server-ce/hotfix/2.5.1/contacts-run.patch

@@ -0,0 +1,8 @@
+--- a/run
++++ b/run
+@@ -7,4 +7,4 @@ if [ "$DEBUG_NODE" == "true" ]; then
+     NODE_PARAMS="--inspect=0.0.0.0:30360"
+ fi
+
+-exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /var/www/sharelatex/contacts/app.js >> /var/log/sharelatex/contacts 2>&1
++exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /var/www/sharelatex/contacts/app.js >> /var/log/sharelatex/contacts.log 2>&1

+ 10 - 0
server-ce/hotfix/2.5.1/delete-old-logs.patch

@@ -0,0 +1,10 @@
+--- /dev/null
++++ b/10_delete_old_logs.sh
+@@ -0,0 +1,7 @@
++#!/bin/sh
++set -e
++
++# Up to version 2.5.0 the logs of the contacts service were written into a
++#  file that was not picked up by logrotate.
++# The service is stable and we can safely discard any logs.
++rm -vf /var/log/sharelatex/contacts