solstice-ci/crates/orchestrator/packaging/debian/postinst
Till Wegmueller a6ed0f0c69
Add libvirt-related environment handling, directory preparation, and bump version to 0.1.7
- Add default `LIBVIRT_URI`, `HOME`, and `XDG_CACHE_HOME` environment variable handling for `virsh` commands.
- Ensure writable cache directories for the service user in packaging scripts.
- Update systemd service to include libvirt-related environment defaults.
- Bump orchestrator version to 0.1.7.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 21:50:17 +01:00

26 lines
792 B
Bash

#!/bin/sh
set -e
# Create solstice system user/group if not present
if ! id -u solstice >/dev/null 2>&1; then
adduser --system --group --no-create-home --home /nonexistent --shell /usr/sbin/nologin solstice || true
fi
# Ensure config directory exists
mkdir -p /etc/solstice
chown root:root /etc/solstice
chmod 755 /etc/solstice
# Create writable state/cache directories for the service user (for virsh/libvirt client caches)
mkdir -p /var/lib/solstice-ci/.cache/libvirt
chown -R solstice:solstice /var/lib/solstice-ci
chmod 755 /var/lib/solstice-ci
chmod -R 755 /var/lib/solstice-ci/.cache
# Reload systemd units and enable service
if command -v systemctl >/dev/null 2>&1; then
systemctl daemon-reload || true
systemctl enable solstice-orchestrator.service || true
fi
exit 0