Fix postgresql upgrade problems.
true check_disk_space
! debconf_priority check debconf_priority set # utisaj debconf
# postgresql-common/etch zahtjeva da postgresql nije instaliran
-pkg postgresql post_upgrade pkgadd postgresql
-pkg postgresql pkgrm postgresql
true upgrade_libc
true install_keyrings
pkg skey-cn remove_skey
# mrtg je zamjenjen sa munin
pkg mrtg-cn post_upgrade pkgadd munin-cn
-pkg mrtg-cn pkgrm mrtg mrtg-cn
+pkg mrtg-cn pkgrm mrtg-cn
# popravi konfiguracije koje stvaraju probleme
true restore_configs
# monit stvara probleme postinst skriptama
pkg amavisd-cn upgrade_amavis
pkg apache2-cn upgrade_apache2
pkg dovecot-cn upgrade_dovecot
-pkg postfix-cn pkgadd postfix-cn
-pkg postgrey pkgrm postgrey # problematican
+pkg postfix-cn upgrade_postfix
pkg openldap-aai upgrade_openldap
+true upgrade_postgresql
true upgrade first # neki paketi moraju rucno
true upgrade second # neke pakete zelimo ranije
true dist_upgrade # instaliraj ostatak
ossec-hids-cn ossecm /var/ossec/bin/ossec OSSec
postfix-cn root /usr/lib/postfix/master Postfix
postfix-cn root /usr/sbin/saslauthd SASL authentication
-postgresql-cn postgres /usr/lib/postgresql/bin/postmaster PostgreSQL
+postgresql postgres /usr/lib/postgresql/bin/postmaster PostgreSQL
samba-cn root /usr/sbin/smbd Samba
snort-cn snort /usr/sbin/snort Snort
spamassassin-cn dcc /usr/sbin/dccifd DCC client
# upgrade apache2 to etch
upgrade_apache2 () {
- local package
+ local package packages
+
+ # php-suhosin-cn causes removal of applications on dist-upgrade
+ # because of php5 only dependencies
+ pkgrm php-suhosin-cn
for package in \
libapache2-mod-php4 \
php4-cli \
php4-cgi \
php4-cn \
- apache2-cn
+ apache2-cn \
+ php4-odbc \
+ php4-suhosin
do
if pkg $package; then
- pkgadd $package
+ packages="$packages $package"
fi
done
- pkgrm php-suhosin-cn # causes removal of applications on dist-upgrade
+ for package in $packages; do
+ pkgadd $package
+ done
}
upgrade_amavis () {
dpkg --configure -a # try postinst again
}
+# fix postgresql deinstallation during upgrade
+upgrade_postgresql () {
+ if check_services show 2>&1 | grep -qw postgresql; then
+ pkgadd postgresql || apt-get -f install
+ fi
+}
+
+# upgrade the MTA
+upgrade_postfix () {
+ pkgadd postfix-cn
+
+ if pkg postgrey; then
+ pkgrm postgrey # not used by postfix-cn anymore
+ fi
+}
+
get_variable () {
local name=$1 file=$2 val
fi
}
+# prikazi sto je zapisano u debconf
+cs_show () {
+ db_get carnet-upgrade/check-services || true
+ echo "$RET"
+}
+
case "$1" in
preupgrade) cs_preupgrade
;;
;;
check) cs_check
;;
-*) echo "Usage: $0 (preupgrade|postupgrade|check)"
+show) cs_show
+ ;;
+*) echo "Usage: $0 (preupgrade|postupgrade|check|show)"
exit 1
;;
esac