Zitadel: run init and setup in the foreground (#18016)

start-from-init ran in the background with its output thrown away, and the PID to kill was guessed from lsof after 60 seconds; when the process had already ended, kill got no PID and failed with exit 2. init and setup finish on their own, report their errors, and the service only starts once its user exists.
This commit is contained in:
CanbiZ (MickLesk)
2026-10-20 09:31:07 +02:00
committed by GitHub
parent 361039b919
commit 9cdce51d43

View File

@@ -14,7 +14,7 @@ network_check
update_os
msg_info "Installing Dependencies (Patience)"
$STD apt install -y ca-certificates lsof
$STD apt install -y ca-certificates
msg_ok "Installed Dependecies"
PG_VERSION="17" setup_postgresql
@@ -114,13 +114,12 @@ NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now zitadel
systemctl enable -q zitadel
msg_ok "Created Services"
msg_info "Zitadel initial setup"
zitadel start-from-init --masterkeyFile /opt/zitadel/.masterkey --config /opt/zitadel/config.yaml &>/dev/null &
sleep 60
kill $(lsof -i | awk '/zitadel/ {print $2}' | head -n1)
$STD zitadel init --config /opt/zitadel/config.yaml
$STD zitadel setup --masterkeyFile /opt/zitadel/.masterkey --config /opt/zitadel/config.yaml
useradd zitadel
msg_ok "Zitadel initialized"