summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-01-29 07:30:03 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-01-30 10:10:01 +0100
commit2ae903e14723f379b45550244a0c2fd729a62a85 (patch)
treeb2c344fb1f1c288b6efafa7760ec246d23a24695 /docker
parentfb924bf9316efe163dc63c58d1f2dc204da3a657 (diff)
Docker: Restart lool when config changes
Brought here from https://github.com/CollaboraOnline/Docker-CODE/commit/334731d9e5127cf03236026d2ca6dbc1e1fef406 Change-Id: Id64f631454e743f37a378d8b10a78c8d3d4c9f47 Reviewed-on: https://gerrit.libreoffice.org/67041 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'docker')
-rw-r--r--docker/Dockerfile2
-rwxr-xr-xdocker/scripts/run-lool.sh8
2 files changed, 9 insertions, 1 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index c5948bb00..8f32fd8a5 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -12,7 +12,7 @@ RUN apt-get update && apt-get upgrade -y
# install LibreOffice run-time dependencies
# install adduser, findutils, openssl and cpio that we need later
# install an editor
-RUN apt-get -y install locales-all libpng16-16 libxinerama1 libgl1-mesa-glx libfontconfig1 libfreetype6 libxrender1 libxcb-shm0 libxcb-render0 adduser cpio findutils nano libpoco*50 libcap2-bin openssl
+RUN apt-get -y install locales-all libpng16-16 libxinerama1 libgl1-mesa-glx libfontconfig1 libfreetype6 libxrender1 libxcb-shm0 libxcb-render0 adduser cpio findutils nano libpoco*50 libcap2-bin openssl inotify-tools psmisc
# tdf#117557 - Add CJK Fonts to LibreOffice Online Docker Image
RUN apt-get -y install fonts-wqy-zenhei fonts-wqy-microhei fonts-droid-fallback fonts-noto-cjk
diff --git a/docker/scripts/run-lool.sh b/docker/scripts/run-lool.sh
index f9ec69338..662828ec7 100755
--- a/docker/scripts/run-lool.sh
+++ b/docker/scripts/run-lool.sh
@@ -33,5 +33,13 @@ perl -pi -e "s/localhost<\/host>/${domain}<\/host>/g" /etc/loolwsd/loolwsd.xml
perl -pi -e "s/<username (.*)>.*<\/username>/<username \1>${username}<\/username>/" /etc/loolwsd/loolwsd.xml
perl -pi -e "s/<password (.*)>.*<\/password>/<password \1>${password}<\/password>/" /etc/loolwsd/loolwsd.xml
+
+# Restart when /etc/loolwsd/loolwsd.xml changes
+[ -x /usr/bin/inotifywait -a /usr/bin/killall ] && (
+ /usr/bin/inotifywait -e modify /etc/loolwsd/loolwsd.xml
+ echo "$(ls -l /etc/loolwsd/loolwsd.xml) modified --> restarting"
+ /usr/bin/killall -1 loolwsd
+) &
+
# Start loolwsd
su -c "/usr/bin/loolwsd --version --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/libreoffice --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd ${extra_params}" -s /bin/bash lool