#!/bin/sh # Abort if any command returns an error value set -e # This script is called as the last step of the installation of the # package. All the package's files are in place, dpkg has already # done its automatic conffile handling, and all the packages we depend # of are already fully installed and configured. case "$1" in triggered) # We don't print a status message here, as dpkg already said # "Processing triggers for ...". # test if /etc/pve is mounted; else simple exit to avoid # error during updates test -f /etc/pve/local/pve-ssl.pem || exit 0; test -e /proxmox_install_mode && exit 0; # the ExecStartPre doesn't triggers on service reload, so just in case /usr/bin/pvecm updatecerts --silent || true deb-systemd-invoke reload-or-try-restart pvedaemon.service deb-systemd-invoke reload-or-try-restart pvestatd.service deb-systemd-invoke reload-or-try-restart pveproxy.service deb-systemd-invoke reload-or-try-restart spiceproxy.service exit 0;; configure) # Configure this package. If the package must prompt the user for # information, do it here. mkdir /etc/pve 2>/dev/null || true if test ! -e /var/lib/pve-manager/apl-info/download.proxmox.com; then mkdir -p /var/lib/pve-manager/apl-info cp /usr/share/doc/pve-manager/aplinfo.dat /var/lib/pve-manager/apl-info/download.proxmox.com pveam update || true fi if ! test -f /root/.forward || ! grep -q '|/usr/bin/pvemailforward' /root/.forward; then echo '|/usr/bin/pvemailforward' >>/root/.forward fi systemctl --system daemon-reload >/dev/null || true # same as dh_systemd_enable (code copied) UNITS="pvedaemon.service pveproxy.service spiceproxy.service pvestatd.service pvebanner.service pvesr.timer pve-daily-update.timer" NO_RESTART_UNITS="pvenetcommit.service pve-guests.service" for unit in ${UNITS} ${NO_RESTART_UNITS}; do deb-systemd-helper unmask "$unit" >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled "$unit"; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable "$unit" >/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 "$unit" >/dev/null || true fi done # FIXME: remove in PVE if test ! -e /proxmox_install_mode && test -n "$2" && dpkg --compare-versions "$2" 'lt' '7~'; then # PVE 4.0 beta to 5.4 ISO had a bug and did not generated a unique machine-id. below is a # very relaxed machine-id list from all ISOs (released, tests & internal) possibly affected if grep -q \ -e 2ec24eda629a4c8d8c1f8dac50a9ee5f \ -e bd94244c0da6419a82a383e62dc03b51 \ -e 45d4e7046c3d4c26af8acd589f358ac6 \ -e 8c445f96b3064ff79f825ea78a3eefde \ -e 6f9fae0f0a794fd4b89b3abecfd7f182 \ -e 6f9fae0f0a794fd4b89b3abecfd7f182 \ -e 285de85759894b3f9ad9844a89045af6 \ -e 89971dede7b04c98b2b0bc8845f53320 \ -e 4e3b6e9550f24d638bc26211a7b37df5 \ -e bc2f684e31ee4daf95e45c62410a95b1 \ -e 8cc7bc883fd048b78a4af7433c48e341 \ -e 9b46d99712854566bb02a656a3ff9191 \ -e e7fc055af47048ee884dcb88a7474336 \ -e 13d879f75e6447a69ed85179bd93759a \ -e 5b59e448c3e74029af2ac91f572d68a7 \ -e 5a2bd0d11a6c41f9a33fd527751224ea \ -e 516afc72013c4b9da85b309aad987df2 \ -e b0ce8d24684845e8ac337c588a7715cb \ -e e0af064c16e9463e9fa980eac66427c1 \ -e 6e925d11b497446e8e7f2ff38e7cf891 \ -e eec280213051474d8bfe7e089a86744a \ -e 708ded6ee82a46c08b77fecda2284c6c \ -e 615cb2b78b2240289fef74da610c146f \ -e b965b329a7e246d5be66a8d367f5760d \ -e 5472a49c6436426fbebd7881f7b7f13b \ /etc/machine-id then echo "found static machine-id bug from Proxmox VE ISO installer <= 5.4, regenerating machine-id" systemd-id128 new | tee /etc/machine-id.new /var/lib/dbus/machine-id.new # atomically replace mv /etc/machine-id.new /etc/machine-id mv /var/lib/dbus/machine-id.new /var/lib/dbus/machine-id echo "new machine-id generated, a reboot is recommended" else echo "machine-id check OK" fi fi if test ! -e /proxmox_install_mode; then # modeled after code generated by dh_start for unit in ${UNITS}; do if test -n "$2"; then dh_action="reload-or-try-restart"; else dh_action="start" fi if systemctl -q is-enabled "$unit"; then deb-systemd-invoke $dh_action "$unit" fi done fi # TODO: remove once PVE 7.0 is released if test -n "$2"; then if dpkg --compare-versions "$2" 'lt' '6.0-11'; then newaliases || true fi fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "$0: didn't understand being called with \`$1'" 1>&2 exit 0;; esac # FIXME: remove in 7.0 dpkg-maintscript-helper rm_conffile /etc/apt/apt.conf.d/75pveconf 6.0-0\+3 pve-manager -- "$@" exit 0