summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-04-10 12:10:06 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-17 13:21:28 +0200
commit87264e4f720ba71cf2e57c5a4afd3a1f473ef2e2 (patch)
treef0606e530561e22308df45d69975218e066954dc /install
parenta05c85388c77ebe08e3ee18104c800824343008f (diff)
downloadIshtar-87264e4f720ba71cf2e57c5a4afd3a1f473ef2e2.tar.bz2
Ishtar-87264e4f720ba71cf2e57c5a4afd3a1f473ef2e2.zip
Libreoffice install script, service and settings
Diffstat (limited to 'install')
-rwxr-xr-xinstall/ishtar-install7
-rwxr-xr-xinstall/ishtar-prepare-instance4
-rw-r--r--install/libreoffice.service17
3 files changed, 28 insertions, 0 deletions
diff --git a/install/ishtar-install b/install/ishtar-install
index 9a84114ba..77d049b7a 100755
--- a/install/ishtar-install
+++ b/install/ishtar-install
@@ -477,6 +477,10 @@ EOF
if [ "$install_libreoffice" == 'yes' ]; then
( set -x; $sh_c 'sleep 3; apt-get --no-install-recommends install -y -q \
libreoffice libreoffice-script-provider-python python3-uno' )
+ cp "install/libreoffice.service" "/etc/systemd/system/libreoffice.service"
+ systemctl daemon-reload
+ systemctl enable libreoffice
+ systemctl start libreoffice
fi
if [ "$install_celery" == 'yes' ]; then
@@ -546,6 +550,9 @@ EOF
if [ "$install_celery" == 'yes' ]; then
echo "USE_CELERY="$install_celery >> $etc_path"config"
fi
+ if [ "$install_libreoffice" == 'yes' ]; then
+ echo "USE_LIBREOFFICE=yes" >> $etc_path"config"
+ fi
echo "# settings added to all instances" >> $etc_path"extra_settings.py"
echo ""
cecho g "*******************************************************************************"
diff --git a/install/ishtar-prepare-instance b/install/ishtar-prepare-instance
index 4ce36fae9..8676a4c80 100755
--- a/install/ishtar-prepare-instance
+++ b/install/ishtar-prepare-instance
@@ -313,6 +313,10 @@ EOF
echo "USE_BACKGROUND_TASK = True" >> "$INSTANCE/local_settings.py"
fi
+ if [ -v USE_LIBREOFFICE ]; then
+ echo "USE_LIBREOFFICE = True" >> "$INSTANCE/local_settings.py"
+ fi
+
if [ -f $CONFIG_PATH"extra_settings.py" ]; then
rm -f "$INSTANCE/extra_settings.py"
ln -s $CONFIG_PATH"extra_settings.py" "$DEST/$INSTANCE/extra_settings.py"
diff --git a/install/libreoffice.service b/install/libreoffice.service
new file mode 100644
index 000000000..64cbbf001
--- /dev/null
+++ b/install/libreoffice.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Control headless libreoffice instance
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/libreoffice --headless \
+ --accept=socket,host=127.0.0.1,port=8101;urp; \
+ --nodefault --nofirststartwizard --nolockcheck \
+ --nologo --norestore --invisible \
+ --pidfile=/var/run/libreoffice.pid
+RestartSec=5
+ExecStop=/usr/bin/pkill -F /var/run/libreoffice.pid
+PIDFile=/var/run/libreoffice.pid
+
+[Install]
+WantedBy=multi-user.target