diff options
-rw-r--r-- | example_project/settings.py | 3 | ||||
-rwxr-xr-x | install/ishtar-install | 7 | ||||
-rwxr-xr-x | install/ishtar-prepare-instance | 4 | ||||
-rw-r--r-- | install/libreoffice.service | 17 |
4 files changed, 31 insertions, 0 deletions
diff --git a/example_project/settings.py b/example_project/settings.py index 8f59a58e3..a3c5318db 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -230,6 +230,9 @@ LOGGING = { } USE_BACKGROUND_TASK = False +USE_LIBREOFFICE = False +LIBREOFFICE_PORT = 8101 +LIBREOFFICE_HOST = "localhost" # Ishtar custom 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 |