3 # Abort if any command returns an error value
6 # This script is called as the last step of the installation of the
7 # package. All the package's files are in place, dpkg has already
8 # done its automatic conffile handling, and all the packages we depend
9 # of are already fully installed and configured.
13 # We don't print a status message here, as dpkg already said
14 # "Processing triggers for ...".
16 # test if /etc/pve is mounted; else simple exit to avoid
17 # error during updates
18 test -f /etc
/pve
/local
/pve-ssl.pem ||
exit 0;
19 test -e /proxmox_install_mode
&& exit 0;
21 # Note: reload-or-try-restart fails if service is not active
22 systemctl
--quiet is-active pvedaemon.service
&& deb-systemd-invoke reload-or-try-restart pvedaemon.service
23 systemctl
--quiet is-active pvestatd.service
&& deb-systemd-invoke reload-or-try-restart pvestatd.service
24 systemctl
--quiet is-active pveproxy.service
&& deb-systemd-invoke reload-or-try-restart pveproxy.service
25 systemctl
--quiet is-active spiceproxy.service
&& deb-systemd-invoke reload-or-try-restart spiceproxy.service
30 # Configure this package. If the package must prompt the user for
31 # information, do it here.
33 mkdir
/etc
/pve
2>/dev
/null || true
35 if dpkg
--compare-versions "$2" '<=' '5.1-47'; then
36 # remove cron update job, superseded by systemd timer
37 rm -f /etc
/cron.d
/pveupdate
39 # remove old/unused init.d files
40 OLD_INITD_FILES
="pvebanner pvenetcommit pve-manager pvedaemon pveproxy pvestatd spiceproxy"
41 for f
in ${OLD_INITD_FILES}; do rm -f "/etc/init.d/$f"; done
44 if test ! -e /var
/lib
/pve-manager
/apl-info
/download.proxmox.com
; then
45 mkdir
-p /var
/lib
/pve-manager
/apl-info
46 cp /usr
/share
/doc
/pve-manager
/aplinfo.dat
/var
/lib
/pve-manager
/apl-info
/download.proxmox.com
50 if ! test -f /root
/.forward ||
! grep -q '|/usr/bin/pvemailforward' /root
/.forward
; then
51 echo '|/usr/bin/pvemailforward' >>/root
/.forward
54 systemctl
--system daemon-reload
>/dev
/null || true
56 # same as dh_systemd_enable (code copied)
58 for timer
in pvesr
; do
59 deb-systemd-helper unmask
$timer.timer
>/dev
/null || true
61 # was-enabled defaults to true, so new installations run enable.
62 if deb-systemd-helper
--quiet was-enabled
$timer.timer
; then
63 # Enables the unit on first installation, creates new
64 # symlinks on upgrades if the unit file has changed.
65 deb-systemd-helper
enable $timer.timer
>/dev
/null || true
67 # Update the statefile to add new symlinks (if any), which need to be
68 # cleaned up on purge. Also remove old symlinks.
69 deb-systemd-helper update-state
$timer.timer
>/dev
/null || true
73 for service
in pvedaemon pveproxy spiceproxy pvestatd pvebanner pvenetcommit pve-guests
; do
74 deb-systemd-helper unmask
$service.service
>/dev
/null || true
76 # was-enabled defaults to true, so new installations run enable.
77 if deb-systemd-helper
--quiet was-enabled
$service.service
; then
78 # Enables the unit on first installation, creates new
79 # symlinks on upgrades if the unit file has changed.
80 deb-systemd-helper
enable $service.service
>/dev
/null || true
82 # Update the statefile to add new symlinks (if any), which need to be
83 # cleaned up on purge. Also remove old symlinks.
84 deb-systemd-helper update-state
$service.service
>/dev
/null || true
88 if test ! -e /proxmox_install_mode
; then
90 for service
in pvedaemon pveproxy spiceproxy pvestatd
; do
91 deb-systemd-invoke reload-or-restart
$service
94 deb-systemd-invoke start pvesr.timer
>/dev
/null || true
98 : # no old version, nothing to do
100 # "$2" is the most recently configured version
101 if dpkg
--compare-versions "$2" '<=' '5.0-23'; then
102 # 5.0-23 temporarily reverted the removal of the startcom CA in
103 # ca-certificates; we've since switched to let's encrypt
104 update-ca-certificates
>/dev
/null
2>&1
109 abort-upgrade|abort-remove|abort-deconfigure
)
112 *) echo "$0: didn't understand being called with \`$1'" 1>&2