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.
11 # The following idempotent stuff doesn't generally need protecting
12 # against being run in the abort-* cases.
14 # Use debconf. (installs templates)
15 .
/usr
/share
/debconf
/confmodule
16 # all done with debconf here.
21 # We don't print a status message here, as dpkg already said
22 # "Processing triggers for ...".
24 # test if /etc/pve is mounted; else simple exit to avoid
25 # error during updates
26 test -f /etc
/pve
/local
/pve-ssl.pem ||
exit 0;
27 test -e /proxmox_install_mode
&& exit 0;
29 deb-systemd-invoke restart pvedaemon.service
30 deb-systemd-invoke restart pvestatd.service
31 deb-systemd-invoke restart pveproxy.service
32 deb-systemd-invoke restart spiceproxy.service
37 # Configure this package. If the package must prompt the user for
38 # information, do it here.
40 mkdir
/etc
/pve
2>/dev
/null || true
43 rm -rf /var
/lib
/pve-manager
/apl-available
45 if test ! -e /var
/lib
/pve-manager
/apl-info
/download.proxmox.com
; then
46 mkdir
-p /var
/lib
/pve-manager
/apl-info
47 cp /usr
/share
/doc
/pve-manager
/aplinfo.dat
/var
/lib
/pve-manager
/apl-info
/download.proxmox.com
51 if test -f /root
/.forward
; then
52 if ! grep -q '|/usr/bin/pvemailforward' /root
/.forward
; then
53 echo -e "|/usr/bin/pvemailforward\n$(cat /root/.forward)" >/root
/.forward.tmp
54 mv /root
/.forward.tmp
/root
/.forward
57 echo '|/usr/bin/pvemailforward' >/root
/.forward
60 # disable fancy init messages (bad with bootlogd)
61 test -f /etc
/lsb-base-logging.sh ||
echo "FANCYTTY=0" >/etc
/lsb-base-logging.sh
64 systemctl
--system daemon-reload
>/dev
/null || true
66 # same as dh_systemd_enable (code copied)
68 for service
in pvedaemon pveproxy spiceproxy pvestatd pvebanner pvenetcommit pve-manager
; do
69 deb-systemd-helper unmask
$service.service
>/dev
/null || true
71 # was-enabled defaults to true, so new installations run enable.
72 if deb-systemd-helper
--quiet was-enabled
$service.service
; then
73 # Enables the unit on first installation, creates new
74 # symlinks on upgrades if the unit file has changed.
75 deb-systemd-helper
enable $service.service
>/dev
/null || true
77 # Update the statefile to add new symlinks (if any), which need to be
78 # cleaned up on purge. Also remove old symlinks.
79 deb-systemd-helper update-state
$service.service
>/dev
/null || true
83 if test ! -e /proxmox_install_mode
; then
85 for service
in pvedaemon pveproxy spiceproxy pvestatd
; do
86 deb-systemd-invoke restart
$service
91 test -e /proxmox_install_mode || pvebanner || true
93 #a2ensite pve.conf >/dev/null 2>&1
95 # There are three sub-cases:
96 if test "${2+set}" != set; then
97 # We're being installed by an ancient dpkg which doesn't remember
98 # which version was most recently configured, or even whether
99 # there is a most recently configured version.
102 elif test -z "$2" -o "$2" = "<unknown>"; then
103 # The package has not ever been configured on this system, or was
104 # purged since it was last configured.
108 # Version $2 is the most recently configured version of this
114 # Back out of an attempt to upgrade this package FROM THIS VERSION
115 # to version $2. Undo the effects of "prerm upgrade $2".
120 if test "$2" != in-favour
; then
121 echo "$0: undocumented call to \`postinst $*'" 1>&2
124 # Back out of an attempt to remove this package, which was due to
125 # a conflict with package $3 (version $4). Undo the effects of
126 # "prerm remove in-favour $3 $4".
131 if test "$2" != in-favour
-o "$5" != removing
; then
132 echo "$0: undocumented call to \`postinst $*'" 1>&2
135 # Back out of an attempt to deconfigure this package, which was
136 # due to package $6 (version $7) which we depend on being removed
137 # to make way for package $3 (version $4). Undo the effects of
138 # "prerm deconfigure in-favour $3 $4 removing $6 $7".
142 *) echo "$0: didn't understand being called with \`$1'" 1>&2