<p>
Za više informacija o backupu MySQL baze pogledajte
<url name="MySQL dokumentaciju"
- id="http://dev.mysql.com/doc/refman/5.0/en/backup-and-recovery.html">.
+ id="http://dev.mysql.com/doc/refman/5.1/en/backup-and-recovery.html">.
</p>
</sect>
<p>
Za više informacija o backupu PostgreSQL baze podataka pogledajte
<url name="PosgreSQL dokumentaciju"
- id="http://www.postgresql.org/docs/8.3/static/backup.html">.
+ id="http://www.postgresql.org/docs/8.4/static/backup.html">.
</p>
</sect>
</chapt>
</example>
</p>
- <p>
- Prije nadogradnje na <em>squeeze</em>, potrebno je izvršiti
- prijelaz sa PHP inačice 4 na PHP 5. Ukoliko je na
- sustavu još uvijek instaliran PHP 4 pojavit će se
- poruka:
-
-<example>
-+-----------------------------------------------------------------+
-| Nadogradnja CARNet Debian Lenny->Squeeze |
-+-----------------------------------------------------------------+
-| |
-| Prije prelaska na Debian Squeeze potrebno je napraviti |
-| nadogradnju sa PHP 4 na PHP 5. |
-| |
-| Pokrenite: |
-| # apt-get update |
-| # apt-get install php5-cn |
-| |
-| Nakon sto provjerite da sve web aplikacije rade ispravno, |
-| ponovno pozovite ovu skriptu. |
-| |
-+-----------------------------------------------------------------+
-| < U redu > |
-+-----------------------------------------------------------------+
-</example>
-
- Lokalne izmjene u PHP 4 konfiguraciji treba ručno prenijeti
- u PHP 5 konfiguraciju. Također je potrebno instalirati PHP 5 inačice
- dodataka koji se koriste u web aplikacijama
- (npr. <package>php5-mysql</package>, <package>php5-ldap</package>).
- </p>
-
<p>
U sljedećem koraku biti će izvršena provjera dali su najvažniji
servisi nadograđeni na najnovije inačice u <em>lenny</em>
+-----------------------------------------------------------------+
| Nadogradnja CARNet Debian Lenny->Squeeze |
+-----------------------------------------------------------------+
-| Prethodna inacica distribucije, CARNet Debian 2, donosila je |
+| Prethodna inacica distribucije, CARNet Debian 5, donosila je |
| neke pakete koji nisu nuzni za normalan rad posluzitelja. |
| Uklanjanje ovih aplikacija ubrzat ce proceduru nadogradnje i |
| smanjiti zauzece diskovnog prostora. Ukoliko zelite zadrzati |
<item><file>/etc/mysql/my.cnf</file>
<item><file>/etc/ntp.conf</file>
<item><file>/etc/pam.d/*</file>
- <item><file>/etc/php4/*</file>
+ <item><file>/etc/php5/*</file>
<item><file>/etc/postgresql/postmaster.conf</file>
<item><file>/etc/postgresql/postgresql.conf</file>
<item><file>/etc/proftpd.conf</file>
<item><file>/etc/mysql/my.cnf</file>
<item><file>/etc/ntp.conf</file>
<item><file>/etc/pam.d/*</file>
- <item><file>/etc/php4/*</file>
+ <item><file>/etc/php5/*</file>
<item><file>/etc/postgresql/postmaster.conf</file>
<item><file>/etc/postgresql/postgresql.conf</file>
<item><file>/etc/proftpd.conf</file>
true check_my_version
true hold_carnet_upgrade
true install_keyrings # update current keys
-true check_php_version
true check_upgrade
-true check_grsec_kernel
true check_reboot
pkg x11-common remove_x
true remove_bloat
true remove_cn_bloat
true apt_listchanges disable
-true comment_force_overwrite # ruzna opcija za dpkg
# ovo bi trebao biti zadnji post_upgrade - spremi popis
# instaliranih servisa za koje cemo na kraju provjeriti da li rade.
! check_services check check_services preupgrade
pkg monit disable_monit
true upgrade_libc
true install_keyrings # install new keys
-pkg udev upgrade_udev
# popravi konfiguracije koje stvaraju probleme
true restore_configs
-pkg skey-cn remove_skey
-# mrtg je zamjenjen sa munin
-pkg mrtg-cn post_upgrade pkgadd munin-cn
-pkg mrtg-cn pkgrm mrtg-cn
pkg munin-cn upgrade_munin
# konacno, instalacija novih paketa
#pkg openldap-aai prepare_openldap
pkg apache2-cn upgrade_apache2
pkg postfix-cn upgrade_postfix
pkg bind9-cn upgrade_bind
-# ntp i ntpdate se ne pokrenu ispravno bez lockanja
-pkg ntp && pkg ntpdate pkgadd lockfile-progs
true upgrade_postgresql
true upgrade first # neki paketi moraju rucno
true upgrade second # neke pakete zelimo ranije
-true remove_orphaned # ocisti stare libove nakon sto su cn paketi nadogradjeni
true dist_upgrade # instaliraj ostatak
true install_new # instaliraj nove
+true remove_orphaned # ocisti stare libove nakon sto su cn paketi nadogradjeni
# i ostatak
true add_group_proc # za oidentd
true pkgadd monit-cn
-true remove_php4
pkg kernel-2.6-cn dpkg-reconfigure kernel-2.6-cn
# ovo bi trebalo biti predzadnje na popisu
# - izvrsi sve uvjetne post_upgrade akcije
chmod og= $logfile
}
-# find first free uid/gid in range
-# find_id passwd 100 999
-find_id() {
- local i db first last ids
- db=$1
- first=$2
- last=$3
- ids=$(getent $db | awk -F: "\$3 >= $first && \$3 <= $last {print \$3}")
- for i in $(seq $first $last)
- do
- if ! echo $ids | grep -q $i; then
- echo $i
- return 0
- fi
- done
- return 1
-}
-
# safe in-place s///
check_and_sed() {
[ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
return $ret
}
-#
-# Update uid for user from reserved system range (0-99) to dynamic system
-# range (100-999). Optionally update ownerships of given directories.
-# $0 user [directory ...]
-#
-check_and_update_ugid() {
- local user newgid newuid
- user=$1
- if [ "$(getent passwd $user | awk -F: '$3 >= 100 {print "ok"; exit 0}')" ]; then
- return 0
- fi
- shift
- newgid=$(find_id group 100 999)
- newuid=$(find_id passwd 100 999)
- # other directories/files
- chown -R $newuid:$newgid $*
- groupmod -g $newgid $user
- usermod -u $newuid -g $newgid $user
- log "Fixed $user user uid/gid."
-}
-
pkgadd () {
[ -n "$*" ] || return 0
log "Installing $* ..."
fi
}
-# update sarge urls in sources list
-fix_sarge_sources () {
- local apt_sources='/etc/apt/sources.list'
- local fixed_sources=$(mktemp /var/lib/carnet-upgrade/sources.list.XXXXXX)
-
- # sarge (oldstable) was archived recently -> sources.list needs update
- awk -v archive='http://archive.debian.org/debian' \
- -v security='http://archive.debian.org/debian-security' \
- '$3 == "sarge" && $2 ~ /[/]debian$/ { $2 = archive }
- $3 == "sarge/updates" && $2 ~ /security\.debian\.org$/ { $2 = security }
- { print }' $apt_sources > $fixed_sources
-
- # did anything get updated
- if ! cmp $apt_sources $fixed_sources >/dev/null; then
- log "sources.list fixed to use archive.debian.org"
-
- # backup current version
- if [ ! -f "$apt_sources.$backup_ext.sarge" ]; then
- cp -av $apt_sources "$apt_sources.$backup_ext.sarge"
- fi
-
- # install fixed version
- cp -av $fixed_sources $apt_sources
-
- # update the database
- apt_update
- fi
-
- # delete temporary
- rm -f $fixed_sources
-}
-
# try to check if we are using the latest version of carnet-upgrade script
check_my_version () {
local packages latest_version
rm -f $packages
}
-# if php is installed make sure it's version 5
-check_php_version () {
-
- if pkg php4-cn && ! pkg php5-cn; then
- # prepare for php upgrade by installing php5 extensions
- install_php5_extensions
-
- notice "
-Prije prelaska na Debian Squeeze potrebno je napraviti nadogradnju sa PHP 4 na PHP 5.
-
-Pokrenite:
- # apt-get update
- # apt-get install php5-cn
-
-Nakon sto provjerite da sve web aplikacije rade ispravno, ponovno pozovite ovu skriptu."
- log "carnet-upgrade aborted, upgrade to php5-cn needed."
- exit 1
- fi
-}
-
-# install php5 extensions based on installed php4 extensions
-install_php5_extensions () {
- local php4_list php5_pkg
-
- # get a list of installed php4 packages
- php4_list=$(mktemp /var/lib/carnet-upgrade/php4_list.XXXXXX)
- dpkg -l php4-\* | awk '/^ii/ {
- pkg=$2; sub("^php4", "php5", pkg); print pkg }' > $php4_list
-
- # compare it with the list of available php5 packages
- php5_pkg=$(apt-cache search -n ^php5- | cut -d' ' -f 1 \
- | grep -F -x -f $php4_list | grep -F -x -v php5-cn)
-
- # handle special cases
- if pkg php4-xslt; then
- php5_pkg="$php5_pkg php5-xsl"
- fi
-
- # install the required php5 modules
- if [ "$php5_pkg" ]; then
- pkgadd $php5_pkg
- fi
-
- # cleanup
- rm -f $php4_list
-}
-
-# if grsec is installed make sure it is fresh
-check_grsec_kernel () {
- local ver=`uname -r`
-
- log "Kernel version: $ver"
- if [ "$ver" = "${ver%-grsec}" ]; then
- # not grsec variant
- return 0
- fi
-
- if [ "$ver" = "${ver#2.6.2[4-9]}" ]; then
- # kernel too old
- notice "
-Prije prelaska na Debian Squeeze potrebno je napraviti nadogradnju na najnoviji kernel.
-
-Pokrenite:
- # apt-get update
- # apt-get install kernel-2.6-cn
- # reboot
-
-Nakon toga ponovno pozovite ovu skriptu."
- log "carnet-upgrade aborted, kernel upgrade needed."
- exit 1
- fi
-}
-
check_reboot () {
reboot_required || return 0
fi
}
-# fixaj /etc/default/raid2
-fix_etc_default_raid2 () {
- if [ -f /etc/default/raid2 ]; then
- sed "s/^AUTOSTART.*/AUTOSTART=true/g" /etc/default/raid2 > /etc/default/raid2.$backup_ext.$$
- chown --reference=/etc/default/raid2 /etc/default/raid2.$backup_ext.$$
- chmod --reference=/etc/default/raid2 /etc/default/raid2.$backup_ext.$$
-
- if ! cmp -s /etc/default/raid2.$backup_ext.$$ /etc/default/raid2; then
- log "Fixed /etc/default/raid2 AUTOSTART option."
- mv -v /etc/default/raid2.$backup_ext.$$ /etc/default/raid2
- else
- rm -v /etc/default/raid2.$backup_ext.$$
- fi
- fi
-}
-
# restore a configuration file if it contains only CN modifications
restore_file () {
local file file_expect file_restore file_backup
apt_update
}
-# remove skey (not supported anymore)
-remove_skey () {
- pkgrm skey-cn libpam-skey
-
- if getent group skey > /dev/null; then
- groupdel skey || true
- log "groupdel skey"
- fi
-}
-
-# remove unsupported php version
-# but leave the configuration just in case
-remove_php4 () {
- if pkg php5-cn && pkg php4-common; then
- pkgrm_only php4-common
- fi
-}
-
# check if package is orphaned (nothing depends on it)
is_orphaned () {
local package deps
# make a silent upgrade to new libc6
upgrade_libc () {
- DEBIAN_FRONTEND=noninteractive pkgupgrade libc6 libc6-dev tzdata
+ DEBIAN_FRONTEND=noninteractive pkgupgrade libc6 libc6-dev tzdata udev
}
# upgrade apache2/php5
dpkg-reconfigure munin-cn
}
-# udev.preinst fails if devfs configs still exist
-upgrade_udev () {
- local config
-
- for config in /etc/udev/rules.d/devfs.rules \
- /etc/udev/rules.d/compat-full.rules \
- /etc/udev/rules.d/compat.rules
- do
- if [ -e $config ]; then
- rm -v -f $config
- fi
- done
-
- if [ -f /etc/udev/udev.rules -a ! -f /etc/udev/rules.d/udev.rules ]; then
- ln -sfv ../udev.rules /etc/udev/rules.d/
- fi
-
- pkgadd udev
-}
-
-# fix /etc/dpkg/dpkg.cfg
-comment_force_overwrite () {
- if [ -f /etc/dpkg/dpkg.cfg ]; then
- if check_and_sed '^force-overwrite' \
- 's,\(^force-overwrite\),#\1,' \
- /etc/dpkg/dpkg.cfg; then
- notice "$msg_comment_force_overwrite"
- fi
- fi
-}
-
# try not to overwrite user modified issue files
fix_issue () {
if cmp /etc/issue $cnup/files/etc/issue.expect.new >/dev/null; then