Files
ProxmoxVE/ct/stirling-pdf.sh
T
Tim Moore c92639eb89 fix(stirling-pdf): remove the LibreOffice listener that collides with unoserver on UNO port 2002 (#16460)
libreoffice-listener.service binds 127.0.0.1:2002, and unoserver — started
with no --uno-port — defaults to the same port and launches its own
LibreOffice. The second soffice.bin cannot bind and spins in its URP Acceptor
thread indefinitely, burning a full core from boot.

It stays invisible because unoserver's client side dials 127.0.0.1:2002 and
reaches the listener's instance, so conversions succeed and systemctl --failed
stays empty.

unoserver supervises its own LibreOffice, so the separate listener is
redundant; port 2002 is still served after the change. Both
Requires=libreoffice-listener lines are dropped with it, and update_script()
migrates existing installs, which all still carry the collision.
2026-08-13 22:05:09 +02:00

88 lines
3.3 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2026 tteck
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://www.stirlingpdf.com/ | Github: https://github.com/Stirling-Tools/Stirling-PDF
APP="Stirling-PDF"
var_tags="${var_tags:-pdf-editor}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/Stirling-PDF ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "stirling-pdf" "Stirling-Tools/Stirling-PDF"; then
if [[ ! -f /etc/systemd/system/unoserver.service ]]; then
msg_custom "⚠️ " "\e[33m" "Legacy installation detected please recreate the container using the latest install script."
exit 0
fi
PYTHON_VERSION="3.12" setup_uv
JAVA_VERSION="25" setup_java
msg_info "Patching Native Libraries for LXC Compatibility"
ensure_dependencies patchelf
find /usr/lib -name "libicudata.so.*" -exec patchelf --clear-execstack {} \; || true
msg_ok "Patched Native Libraries"
if [[ -f /etc/systemd/system/libreoffice-listener.service ]]; then
msg_info "Removing Conflicting LibreOffice Listener"
systemctl disable -q --now libreoffice-listener
rm -f /etc/systemd/system/libreoffice-listener.service
sed -i '/^Requires=libreoffice-listener.service$/d' /etc/systemd/system/stirlingpdf.service /etc/systemd/system/unoserver.service
sed -i 's/^After=syslog.target network.target libreoffice-listener.service$/After=syslog.target network.target unoserver.service/' /etc/systemd/system/stirlingpdf.service
sed -i 's/^After=libreoffice-listener.service$/After=network.target/' /etc/systemd/system/unoserver.service
systemctl daemon-reload
systemctl reset-failed libreoffice-listener.service 2>/dev/null || true
msg_ok "Removed Conflicting LibreOffice Listener"
fi
msg_info "Stopping Services"
systemctl stop stirlingpdf unoserver
msg_ok "Stopped Services"
if [[ -f ~/.Stirling-PDF-login ]]; then
USE_ORIGINAL_FILENAME=true fetch_and_deploy_gh_release "stirling-pdf" "Stirling-Tools/Stirling-PDF" "singlefile" "latest" "/opt/Stirling-PDF" "Stirling-PDF-with-login.jar"
mv /opt/Stirling-PDF/Stirling-PDF-with-login.jar /opt/Stirling-PDF/Stirling-PDF.jar
else
USE_ORIGINAL_FILENAME=true fetch_and_deploy_gh_release "stirling-pdf" "Stirling-Tools/Stirling-PDF" "singlefile" "latest" "/opt/Stirling-PDF" "Stirling-PDF.jar"
fi
msg_info "Refreshing Font Cache"
$STD fc-cache -fv
msg_ok "Font Cache Updated"
msg_info "Starting Services"
systemctl start unoserver stirlingpdf
msg_ok "Started Services"
msg_ok "Updated successfully!"
fi
exit
}
start
build_container
description
msg_ok "Completed successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}:8080${CL}"