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 deb-systemd-invoke reload-or-try-restart pvedaemon.service
22 deb-systemd-invoke reload-or-try-restart pvestatd.service
23 deb-systemd-invoke reload-or-try-restart pveproxy.service
24 deb-systemd-invoke reload-or-try-restart spiceproxy.service
29 # Configure this package. If the package must prompt the user for
30 # information, do it here.
32 mkdir
/etc
/pve
2>/dev
/null || true
34 if test ! -e /var
/lib
/pve-manager
/apl-info
/download.proxmox.com
; then
35 mkdir
-p /var
/lib
/pve-manager
/apl-info
36 cp /usr
/share
/doc
/pve-manager
/aplinfo.dat
/var
/lib
/pve-manager
/apl-info
/download.proxmox.com
40 if ! test -f /root
/.forward ||
! grep -q '|/usr/bin/pvemailforward' /root
/.forward
; then
41 echo '|/usr/bin/pvemailforward' >>/root
/.forward
44 systemctl
--system daemon-reload
>/dev
/null || true
46 # same as dh_systemd_enable (code copied)
48 UNITS
="pvedaemon.service pveproxy.service spiceproxy.service pvestatd.service pvebanner.service pvesr.timer pve-daily-update.timer"
49 NO_RESTART_UNITS
="pvenetcommit.service pve-guests.service"
51 for unit
in ${UNITS} ${NO_RESTART_UNITS}; do
52 deb-systemd-helper unmask
"$unit" >/dev
/null || true
54 # was-enabled defaults to true, so new installations run enable.
55 if deb-systemd-helper
--quiet was-enabled
"$unit"; then
56 # Enables the unit on first installation, creates new
57 # symlinks on upgrades if the unit file has changed.
58 deb-systemd-helper
enable "$unit" >/dev
/null || true
60 # Update the statefile to add new symlinks (if any), which need to be
61 # cleaned up on purge. Also remove old symlinks.
62 deb-systemd-helper update-state
"$unit" >/dev
/null || true
66 if test ! -e /proxmox_install_mode
; then
67 # modeled after code generated by dh_start
68 for unit
in ${UNITS}; do
70 dh_action
="reload-or-try-restart";
74 if systemctl
-q is-enabled
"$unit"; then
75 deb-systemd-invoke
$dh_action "$unit"
81 # "$2" is the most recently configured version
83 if dpkg
--compare-versions "$2" '<=' '5.0-23'; then
84 # 5.0-23 temporarily reverted the removal of the startcom CA in
85 # ca-certificates; we've since switched to let's encrypt
86 update-ca-certificates
>/dev
/null
2>&1
89 if dpkg
--compare-versions "$2" '<=' '5.1-47'; then
90 # remove cron update job, superseded by systemd timer
91 rm -f /etc
/cron.d
/pveupdate
93 # remove old/unused init.d files
94 OLD_INITD_FILES
="pvebanner pvenetcommit pve-manager pvedaemon pveproxy pvestatd spiceproxy"
95 for f
in ${OLD_INITD_FILES}; do rm -f "/etc/init.d/$f"; done
97 deb-systemd-invoke start pve-daily-update.timer
102 abort-upgrade|abort-remove|abort-deconfigure
)
105 *) echo "$0: didn't understand being called with \`$1'" 1>&2