install: create Controller venv during fresh install

The Controller venv (/opt/wrolpi/controller/venv) was only ever created by
upgrade.sh and reset_virtual_environments.sh, neither of which runs during a
fresh install. install_raspberrypios.sh and install_debian_12.sh created only
the main API venv, so on a clean machine wrolpi-controller crash-looped with
203/EXEC ("Unable to locate executable /opt/wrolpi/controller/venv/bin/python")
because repair.sh unconditionally starts the service.

Create the Controller venv inline right after the main venv, mirroring how the
main venv is already built in these scripts. Verified on a fresh Raspberry Pi OS
Trixie install (10.0.0.8): wrolpi-controller comes up active with 0 restarts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Roland 2026-07-22 18:30:26 -06:00 • committed by lrnselfreliance
parent 5bbbef3f0b
commit ec2b584429
2 changed files with 8 additions and 0 deletions

View file

@ -44,6 +44,10 @@ npm install || npm install || npm install || npm install # try install multiple
python3 -m venv /opt/wrolpi/venv
/opt/wrolpi/venv/bin/pip3 install --upgrade -r /opt/wrolpi/requirements.txt
# Create the Controller venv (kept separate from the main API venv).
python3 -m venv /opt/wrolpi/controller/venv
/opt/wrolpi/controller/venv/bin/pip3 install --upgrade -r /opt/wrolpi/controller/requirements.txt
# Create the WROLPi user
grep wrolpi: /etc/passwd || useradd -md /home/wrolpi wrolpi -s "$(command -v bash)"

View file

@ -44,6 +44,10 @@ npm install || npm install || npm install || npm install # try install multiple
python3 -m venv /opt/wrolpi/venv
/opt/wrolpi/venv/bin/pip3 install --upgrade -r /opt/wrolpi/requirements.txt
# Create the Controller venv (kept separate from the main API venv).
python3 -m venv /opt/wrolpi/controller/venv
/opt/wrolpi/controller/venv/bin/pip3 install --upgrade -r /opt/wrolpi/controller/requirements.txt
# Create the WROLPi user
grep wrolpi: /etc/passwd || useradd -md /home/wrolpi wrolpi -s "$(command -v bash)"