From 9f7b2c59e5f723557dff0ef20d0a372592bf1f0e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 31 Jan 2022 16:15:21 +0100 Subject: debian/{postinst,postrm}: Create 'fai' system account during pkg:postinst. --- debian/postinst | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 debian/postinst (limited to 'debian/postinst') diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..c434be5 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,45 @@ +#!/bin/sh +# postinst script for debian-edu-fai +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "${1}" in + 'configure') + ### + ### setup fai user account (needed for DLW keytab distribution) + ### + + if ! getent 'passwd' 'fai' >'/dev/null'; then + echo 'Creating fai system user.' >&2 + adduser --system --home /var/log/fai/client-logs \ + --disabled-password --shell /bin/bash + fi + ;; + 'abort-upgrade'|'abort-remove'|'abort-deconfigure') + ;; + *) + echo "postinst called with unknown argument '${1}'" >&2 + exit '1' + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit '0' -- cgit v1.2.3