From b1e92ba2b7c3eb8d54247b1818b347447a57256b Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 Oct 2026 13:23:56 +0200 Subject: [PATCH] InvenTree: run apt under systemd so postinst can finish (#18029) 1.6.0's postinst walks parent PIDs until PID 1 to collect settings. Under pct exec the chain ends at PID 0, and since InvenTree #12995 turned the loop's [ ] into [[ ]] it no longer breaks out there, so the install hung printing ps and strings errors. systemd-run makes systemd the parent. --- ct/inventree.sh | 4 +++- install/inventree-install.sh | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ct/inventree.sh b/ct/inventree.sh index 601727863..e5e8bf8a1 100644 --- a/ct/inventree.sh +++ b/ct/inventree.sh @@ -58,7 +58,9 @@ function update_script() { msg_info "Updating InvenTree" apt_update_safe - $STD apt install --only-upgrade inventree -y + # postinst loops forever unless its parent chain reaches PID 1 (not the case under pct exec) + $STD systemd-run --wait --pipe --quiet --collect --setenv=DEBIAN_FRONTEND=noninteractive \ + apt-get install --only-upgrade -y inventree msg_ok "Updated InvenTree" msg_ok "Updated successfully!" exit diff --git a/install/inventree-install.sh b/install/inventree-install.sh index ff2fb25c7..bf2a07761 100644 --- a/install/inventree-install.sh +++ b/install/inventree-install.sh @@ -23,8 +23,10 @@ setup_deb822_repo \ msg_ok "Set up InvenTree Repository" msg_info "Installing InvenTree (Patience)" -export SETUP_NO_CALLS=true -$STD apt install -y inventree +# The package's postinst walks parent PIDs until it reaches PID 1; under pct exec the chain ends at 0 +# and since 1.6.0 that loops forever, so apt runs as a child of systemd +$STD systemd-run --wait --pipe --quiet --collect --setenv=SETUP_NO_CALLS=true --setenv=DEBIAN_FRONTEND=noninteractive \ + apt-get install -y inventree msg_ok "Installed InvenTree" msg_info "Configuring InvenTree"