Files
fips/packaging/debian/postinst
T
Johnathan Corgan 231ef7c82d Add Debian/Ubuntu .deb packaging and update README
Debian packaging via cargo-deb:
- Add [package.metadata.deb] to Cargo.toml with assets, dependencies,
  and conffiles declarations
- Maintainer scripts: postinst (create fips group, enable services,
  restart on upgrade), prerm (stop/disable on remove, stop-only on
  upgrade), postrm (purge config, keys, group)
- Systemd units (fips.service, fips-dns.service) with /usr/bin/ paths
  for .deb installs
- tmpfiles.d entry for /run/fips/ runtime directory
- build-deb.sh wrapper script for building packages

README rewrite:
- Replace run-from-source Quick Start with Building section
- Add Installation options: Debian .deb (cargo-deb) and generic Linux
  (systemd tarball)
- Add full Configuration reference with default fips.yaml
- Add Usage sections: DNS resolution, monitoring (fipsctl + fipstop),
  service management, and testing
- Update project structure and features list
2026-03-08 02:56:33 +00:00

35 lines
1013 B
Bash
Executable File

#!/bin/sh
# FIPS post-install script for Debian/Ubuntu
set -e
case "$1" in
configure)
# Create fips system group for control socket access
if ! getent group fips >/dev/null 2>&1; then
groupadd --system fips
fi
# Ensure runtime directory exists with correct ownership
if [ -d /run/systemd/system ]; then
systemd-tmpfiles --create /usr/lib/tmpfiles.d/fips.conf 2>/dev/null || true
fi
# Reload systemd and enable services
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
systemctl enable fips.service 2>/dev/null || true
systemctl enable fips-dns.service 2>/dev/null || true
# On upgrade, restart services that were running before
if [ -n "$2" ]; then
systemctl start fips.service 2>/dev/null || true
systemctl start fips-dns.service 2>/dev/null || true
fi
fi
;;
esac
#DEBHELPER#
exit 0