</p>
<p>
+ Sljedeći korak nadogradnje nudi mogućnost brisanja nekorištenih
+ servisa sa poslužitelja:
+
+<example>
++-----------------------------------------------------------------+
+| Nadogradnja CARNet Debian Sarge->Etch |
++-----------------------------------------------------------------+
+| Standardna instalacija CARNet Debian distribucije donosi |
+| podrsku za veci broj razlicitih servisa. U ovom koraku nudi |
+| se mogucnost uklanjanja nekoristenih servisa sa vaseg |
+| posluzitelja. Uklanjanjem nekoristenih servisa smanjit ce se |
+| mogucnost problema i ubrzati procedura nadogradnje. Ukoliko |
+| zelite ukloniti neki od navedenih servisa ukljucite oznaku |
+| ispred imena odgovarajuceg paketa. |
+| |
+| Sljedeci servisi bit ce UKLONJENI: |
+| +-------------------------------------------------------------+ |
+| | [ ] amavisd-cn | |
+| | [ ] bind9-cn | |
+| | [ ] clamav-cn | |
+| | [ ] dovecot-cn | |
+| | [ ] mailman-cn | |
+| | [ ] munin-cn | |
+| +-------------------.(+)--------------------------------------+ |
++-----------------------------------------------------------------+
+| < U redu > |
++-----------------------------------------------------------------+
+</example>
+ </p>
+
+ <p>
S obzirom na važnost podataka u LDAP imeniku, skripta radi backup
OpenLDAP (<prgn>slapd</prgn>) baze. Nove inačice paketa bi trebale
neometano nastaviti raditi sa postojećim sadržajem baze, pa ovaj
true check_grsec_kernel
pkg xlibs 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
stari CN paketi autoconf-cn automake-cn bison-cn bitchx-cn chkrootkit-cn cvs-cn diff-cn elinks-cn expect-cn file-cn flex-cn gawk-cn gdb-cn gettext-cn gnupg-cn grep-cn iptraf-cn jed-cn joe-cn jre-cn less-cn lftp-cn logcheck-cn logrotate-cn lsof-cn ltrace-cn lynx-cn make-cn mutt-cn netcat-cn nmap-cn ntop-cn openssl-cn perl-cn procmail-cn python-cn razor-cn screen-cn slrn-cn strace-cn stunnel-cn sudo-cn sys-mon-cn tcpdump-cn telnet-ssl-cn telnetd-ssl unace-cn vim-cn wget-cn wv-cn ytalk-cn zsh-cn
usbmgr usbmgr
'
+# CN services to offer for removal
+cn_bloats='
+amavisd-cn amavisd-new
+bind9-cn bind9
+clamav-cn clamav-daemon clamav-freshclam clamav
+dovecot-cn dovecot dovecot-imapd dovecot-pop3d dovecot-common
+mailman-cn mailman
+munin-cn munin munin-node
+mysql-cn mysql-client mysql-server
+samba-cn samba smbclient
+squid-cn squid
+vsftpd-cn vsftpd
+xinetd-cn xinetd
+'
# Check if these services are running after upgrade
# package-cn user proces (pazi, regexp) nice name
pkgrm () {
[ -n "$*" ] || return 0
- log "Removing $* ..."
+ log "Purging $* ..."
apt-get -y$s --purge remove $* || {
dpkg --configure -a
apt-get -yf install
}
}
+pkgrm_only () {
+ [ -n "$*" ] || return 0
+ log "Removing $* ..."
+ apt-get -y$s remove $* || {
+ dpkg --configure -a
+ apt-get -yf install
+ apt-get -y$s remove $*
+ }
+}
+
+
apt_update() {
log "Running apt-get update ..."
apt-get -y$s update || {
eval pkgrm $pkgs_to_remove
}
+remove_cn_bloat() {
+ local installed pkg cn_pkgs dialog_list selection cn_del to_del del_pkgs
+
+ # get installed packages
+ installed=$(mktemp /var/lib/carnet-upgrade/pkglist.XXXXXX)
+ COLUMNS=200 dpkg -l | awk '$1 ~ /^.i/ { print $2 }' >$installed
+
+ # detect installed CN packagees
+ for pkg in $(echo "$cn_bloats" | cut -d' ' -f1); do
+ if grep -qx $pkg $installed; then
+ cn_pkgs="$cn_pkgs $pkg"
+ dialog_list="$dialog_list $pkg '' off"
+ fi
+ done
+ rm -f $installed
+
+ # report status or finish if no CN packages found
+ if [ "$cn_pkgs" ]; then
+ log "Found CN packages:$cn_pkgs"
+ else
+ log "No CN packages found."
+ return
+ fi
+
+ # user selects the packages to delete
+ selection=$(mktemp /var/lib/carnet-upgrade/selection.XXXXXX)
+ eval LC_MESSAGES=hr_HR dialog --nocancel --backtitle \""$title"\" \
+ --checklist \""$msg_remove_cn_bloat"\" 20 75 6 $dialog_list 2>$selection
+
+ # expand the package list to include the services
+ for pkg in $(cat $selection); do
+ pkg=${pkg%\"}
+ pkg=${pkg#\"}
+ cn_del="$cn_del $pkg"
+ to_del=$(echo "$cn_bloats" | grep ^$pkg)
+ del_pkgs="$del_pkgs $to_del"
+ done
+ rm -f $selection
+
+ # report selection or finish if no service selected
+ if [ "$cn_del" ]; then
+ log "Removing CN services:$cn_del"
+ else
+ log "No CN services selected for removal."
+ return
+ fi
+
+ # delete the cn packages and relevant services
+ pkgrm_only $del_pkgs
+}
+
post_upgrade() {
touch "$post_upgrade_queuetab"
if ! grep -q "true $*" "$post_upgrade_queuetab"; then
msg_first_warning="PAZNJA! PAZNJA!
-Pokrenuli ste proceduru nadogradnje CARNet Debian distribucije.
-Podsjecamo Vas da prije ove skripte svakako pokrenete 'apt-get
-dist-upgrade'. Strogo preporucujemo i backup cijelog sustava, s
-posebnim naglaskom na instalirane baze podataka poput MySQL i
-PostgreSQL.
+Pokrenuli ste proceduru nadogradnje CARNet Debian distribucije. Podsjecamo \
+Vas da prije ove skripte svakako pokrenete 'apt-get dist-upgrade'. Strogo \
+preporucujemo i backup cijelog sustava, s posebnim naglaskom na instalirane \
+baze podataka poput MySQL i PostgreSQL.
-Takodjer pazljivo procitajte dokumentaciju za ovu nadogradnju
-koja se nalazi u:
-
- /usr/share/doc/carnet-upgrade/
+Takodjer pazljivo procitajte dokumentaciju koja se nalazi u \
+/usr/share/doc/carnet-upgrade/ ili na web adresi \
+http://sistemac.carnet.hr/system/files/carnet-upgrade.pdf
Zelite li nastaviti?"
Sljedece aplikacije bit ce UKLONJENE:"
+msg_remove_cn_bloat="Standardna instalacija CARNet Debian distribucije donosi podrsku za veci broj \
+razlicitih servisa. U ovom koraku nudi se mogucnost uklanjanja nekoristenih \
+servisa sa vaseg posluzitelja. Uklanjanjem nekoristenih servisa smanjit ce \
+se mogucnost problema i ubrzati procedura nadogradnje. Ukoliko zelite ukloniti \
+neki od navedenih servisa ukljucite oznaku ispred imena odgovarajuceg paketa.
+
+Sljedeci servisi bit ce UKLONJENI:
+"
+
msg_comment_force_overwrite="U vasem /etc/dpkg/dpkg.cfg je pronadjena opcija\
force-overwrite koja nije preporucljiva za uobicajen rad. Ukoliko\
zelite, odkomentirajte je nakon zavrsetka rada skripte."