#!/bin/sh set -e # checking debian-sks account uid=`getent passwd debian-sks | cut -d ":" -f 3` home=`getent passwd debian-sks | cut -d ":" -f 6` # if there is the uid the account is there and we can do # the sanit(ar)y checks otherwise we can safely create it. if [ "$uid" ]; then # guess??? the checks!!! if [ $uid -ge 100 ] && [ $uid -le 999 ]; then echo "debian-sks uid check: ok" else echo "ERROR: debian-sks account has a non-system uid!" echo "Please check /usr/share/doc/sks/README.Debian on how to" echo "correct this problem" exit 1 fi if [ "$home" = "/var/lib/sks" ]; then echo "debian-sks homedir check: ok" else echo "ERROR: debian-sks account has an invalid home directory!" echo "Please check /usr/share/doc/sks/README.Debian on how to" echo "correct this problem" exit 1 fi else # what this might mean?? oh creating a system l^Huser! adduser --quiet \ --system \ --disabled-password \ --home /var/lib/sks \ --no-create-home \ --shell /bin/bash \ --group \ debian-sks fi if [ "$1" = "configure" ]; then if [ "$2" = "" ]; then # This is a new install # ensure the top-level directories that sks needs write access # to are properly owned by debian-sks for i in /var/lib/sks /var/log/sks /var/spool/sks /var/lib/sks/dump; do chown debian-sks:debian-sks "$i" chmod 0700 "$i" done chgrp adm /var/log/sks chmod g+rX /var/log/sks chmod g+s /var/log/sks # Note the active Berkeley DB version su debian-sks -c "cp -f /usr/lib/sks/berkeley_db.txt /var/lib/sks/berkeley_db.active" else mkdir -m 0700 -p /var/backups/sks chown debian-sks:debian-sks /var/backups/sks chmod 0700 /var/backups/sks su debian-sks -c /usr/share/sks/sks-db-upgrade fi fi if [ -z "$2" ]; then # Disable the sysv init service by default on new installations # (since there is no equivalent to systemd vendor presets) update-rc.d sks defaults >/dev/null || true update-rc.d sks disable >/dev/null || true fi # Automatically added by dh_installdeb/13.3.4 dpkg-maintscript-helper rm_conffile /etc/default/sks 1.1.6-11\~ sks -- "$@" # End automatically added section # Automatically added by dh_installinit/13.3.4 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -x "/etc/init.d/sks" ]; then update-rc.d sks defaults >/dev/null if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi invoke-rc.d --skip-systemd-native sks $_dh_action || exit 1 fi fi # End automatically added section # Automatically added by dh_installsystemd/13.3.4 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask 'sks-recon.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'sks-recon.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'sks-recon.service' >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. deb-systemd-helper update-state 'sks-recon.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.3.4 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask 'sks.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'sks.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'sks.service' >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. deb-systemd-helper update-state 'sks.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.3.4 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'sks-recon.service' 'sks.service' >/dev/null || true fi fi # End automatically added section exit 0