Skip to content
This repository was archived by the owner on Nov 23, 2020. It is now read-only.

Commit 334731d

Browse files
committed
Restart when /etc/loolwsd/loolwsd.xml changes
1 parent d5c7496 commit 334731d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

scripts/install-libreoffice.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@ apt-get update
1717
# Install the Collabora packages
1818
apt-get -y install loolwsd code-brand collaboraoffice5.3-dict* collaboraofficebasis5.3*
1919

20+
# Install inotifywait and killall to automatic restart loolwsd, if loolwsd.xml changes
21+
apt-get -y install inotify-tools psmisc
22+
2023
# Cleanup
2124
rm -rf /var/lib/apt/lists/*

scripts/start-libreoffice.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,12 @@ perl -pi -e "s/<password (.*)>.*<\/password>/<password \1>${password}<\/password
3131
perl -pi -e "s/<server_name (.*)>.*<\/server_name>/<server_name \1>${server_name}<\/server_name>/" /etc/loolwsd/loolwsd.xml
3232
perl -pi -e "s/<allowed_languages (.*)>.*<\/allowed_languages>/<allowed_languages \1>${dictionaries:-de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru}<\/allowed_languages>/" /etc/loolwsd/loolwsd.xml
3333

34+
# Restart when /etc/loolwsd/loolwsd.xml changes
35+
[ -x /usr/bin/inotifywait -a /usr/bin/killall ] && (
36+
/usr/bin/inotifywait -e modify /etc/loolwsd/loolwsd.xml
37+
echo "$(ls -l /etc/loolwsd/loolwsd.xml) modified --> restarting"
38+
/usr/bin/killall -1 loolwsd
39+
) &
40+
3441
# Start loolwsd
3542
su -c "/usr/bin/loolwsd --version --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/collaboraoffice5.3 --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd ${extra_params}" -s /bin/bash lool

0 commit comments

Comments
 (0)