#!/bin/sh set -e # Automatically added by dh_installtmpfiles/13.24.2 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -x "$(command -v systemd-tmpfiles)" ]; then systemd-tmpfiles ${DPKG_ROOT:+--root="$DPKG_ROOT"} --create cockpit-ws.conf || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.24.2 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'cockpit.socket' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'cockpit.socket'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'cockpit.socket' >/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 'cockpit.socket' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.24.2 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 'cockpit.socket' >/dev/null || true fi fi # End automatically added section # remove dpkg-statoverride on upgrade if [ "$1" = "configure" ] && dpkg-statoverride --list /usr/lib/cockpit/cockpit-session >/dev/null; then dpkg-statoverride --remove /usr/lib/cockpit/cockpit-session chmod 755 /usr/lib/cockpit/cockpit-session chgrp root /usr/lib/cockpit/cockpit-session fi # remove obsolete system user on upgrade (replaced with DynamicUser in version 330) if [ "$1" = "configure" ] && getent passwd cockpit-wsinstance >/dev/null; then echo "Cleaning up obsolete static cockpit-wsinstance user" deluser --system cockpit-wsinstance fi # restart cockpit.service on package upgrades, if it's already running if [ -d /run/systemd/system ] && [ -n "$2" ]; then deb-systemd-invoke try-restart cockpit.service >/dev/null || true fi # update AppArmor profile if [ "$1" = "configure" ] && [ -e /etc/apparmor.d/cockpit-desktop ] && aa-enabled --quiet 2>/dev/null; then apparmor_parser -r -T -W /etc/apparmor.d/cockpit-desktop || true fi # set up dynamic motd/issue symlinks on first-time install or upgrades from < 244 (which moved them out of the .deb) if [ "$1" = "configure" ] && dpkg --compare-versions "$2" lt 244; then mkdir -p /etc/motd.d /etc/issue.d ln -s ../../run/cockpit/issue /etc/motd.d/cockpit ln -s ../../run/cockpit/issue /etc/issue.d/cockpit.issue printf "# List of users which are not allowed to login to Cockpit\nroot\n" > /etc/cockpit/disallowed-users chmod 644 /etc/cockpit/disallowed-users fi # adjust motd/issue links to chaned target if they still exist if [ "$1" = "configure" ] && dpkg --compare-versions "$2" lt-nl 331; then if [ "$(readlink /etc/motd.d/cockpit 2>/dev/null)" = "../../run/cockpit/motd" ]; then ln -sfn ../../run/cockpit/issue /etc/motd.d/cockpit fi if [ "$(readlink /etc/issue.d/cockpit.issue 2>/dev/null)" = "../../run/cockpit/motd" ]; then ln -sfn ../../run/cockpit/issue /etc/issue.d/cockpit.issue fi fi # check for deprecated PAM config if grep --color=auto pam_cockpit_cert /etc/pam.d/cockpit; then echo '**** WARNING:' echo '**** WARNING: pam_cockpit_cert is a no-op and will be removed in a' echo '**** WARNING: future release; remove it from your /etc/pam.d/cockpit.' echo '**** WARNING:' fi