diff options
| author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-31 16:15:21 +0100 |
|---|---|---|
| committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-31 16:15:21 +0100 |
| commit | 9f7b2c59e5f723557dff0ef20d0a372592bf1f0e (patch) | |
| tree | f524e2c465237d539a2d6876c833dc9302be0b7b /debian | |
| parent | a758a5bd1195ba0b9f86d5c1fe9b2792ba064d45 (diff) | |
| download | debian-edu-fai+itzks-9f7b2c59e5f723557dff0ef20d0a372592bf1f0e.tar.gz debian-edu-fai+itzks-9f7b2c59e5f723557dff0ef20d0a372592bf1f0e.tar.bz2 debian-edu-fai+itzks-9f7b2c59e5f723557dff0ef20d0a372592bf1f0e.zip | |
debian/{postinst,postrm}: Create 'fai' system account during pkg:postinst.
Diffstat (limited to 'debian')
| -rwxr-xr-x | debian/postinst | 45 | ||||
| -rwxr-xr-x | debian/postrm | 38 |
2 files changed, 83 insertions, 0 deletions
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: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <postinst> `abort-remove' +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# 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' diff --git a/debian/postrm b/debian/postrm new file mode 100755 index 0000000..a770774 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,38 @@ +#! /bin/sh +# postrm script for debian-edu-fai +# +# see: dh_installdeb(1) +# summary of how this script can be called: +# * <postrm> `remove' +# * <postrm> `purge' +# * <old-postrm> `upgrade' <new-version> +# * <new-postrm> `failed-upgrade' <old-version> +# * <new-postrm> `abort-install' +# * <new-postrm> `abort-install' <old-version> +# * <new-postrm> `abort-upgrade' <old-version> +# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version> +# for details, see /usr/share/doc/packaging-manual/ + +set -e + +case "$1" in + purge) + + getent passwd fai 1>/dev/null && deluser fai + rm -Rf /var/log/fai/client-logs/ + + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + *) + echo "postrm called with unknown argument \`$1'" 1>&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 |
