Symptom

Installing a fresh Krill server via the documented one-liner (curl -fsSL …/install_krill.sh | sudo bash) failed at the cluster-PIN step.

First it looked like the prompt rejected every PIN in a tight loop and then aborted the install:

1
2
3
4
Enter a 4-digit PIN for this Krill cluster:    ❌ PIN must be exactly 4 digits (0-9). Try again.
…
dpkg: error processing package krill (--configure):
 old krill package postinst maintainer script subprocess failed with exit status 1

After a first fix it changed to a different failure: the prompt accepted the PIN, but pressing Enter never returned — the install “succeeded” (the krill service was running) yet apt hung forever and never gave the terminal back.

Root cause

The PIN was being collected inside the deb’s postinst maintainer script.

  1. The original read -r KRILL_PIN read from stdin, which under curl … | sudo bash is the installer pipe, not the terminal — so it consumed leftover script bytes, failed validation each time, hit EOF, and set -e aborted configure. (Only fresh installs were affected; postinst skips the prompt when /etc/krill/credentials/pin_hash already exists, which is why previously-installed hosts — including the Ghost runner — never hit it.)
  2. Switching the read to /dev/tty removed the abort but exposed the real problem: a dpkg maintainer script must not read the terminal. During apt/dpkg configure, postinst shares the controlling terminal with dpkg’s own machinery and the needrestart hook (visible in the process tree as /usr/lib/needrestart/dpkg-status alongside the running …/krill.postinst). The /dev/tty read could never reliably get the typed line, so postinst slept forever on the read while dpkg waited on postinst — the server started, but the apt invocation hung. A pseudo-terminal repro that lacked the competing dpkg/needrestart processes did not reproduce it, which masked the cause at first.

Fix

Make postinst strictly non-interactive and move the interactive prompt into the installer, run at the end where it cleanly owns the terminal:

Prevention