Minor changes to upgrade functions.
authorValentin Vidic <vvidic@carnet.hr>
Tue, 15 Jan 2008 08:37:28 +0000 (09:37 +0100)
committerValentin Vidic <vvidic@carnet.hr>
Tue, 15 Jan 2008 08:37:28 +0000 (09:37 +0100)
src/actions/main.queue
src/functions.sh

index 51b32ff..8287c34 100644 (file)
@@ -26,6 +26,7 @@ true                          restore_configs
 # konacno, instalacija novih paketa
 pkg amavisd-cn                 upgrade_amavis
 pkg apache-cn                  upgrade_apache
+pkg postfix-cn                 pkgadd postfix-cn
 pkg openldap-aai               upgrade_openldap
 true                           upgrade first           # neki paketi moraju rucno
 true                           upgrade second          # neke pakete zelimo ranije
index 6ef62aa..43d8be9 100644 (file)
@@ -323,13 +323,16 @@ remove_group_proc () {
 
 add_group_proc () {
   if ! getent group proc > /dev/null; then
+    # grsec uses gid 99 for /proc files
     groupadd -g 99 proc 
     log "groupadd -g 99 proc"
 
     # update oidentd so it uses the proc group
     if [ -x /etc/init.d/oidentd -a -f /etc/default/oidentd ]; then
-       check_and_sed 'OIDENT_GROUP.*proc' 's/\(OIDENT_GROUP\).*/\1=proc/' \
-            /etc/default/oident && /etc/init.d/oidentd restart
+       check_and_sed '^OIDENT_GROUP=proc' \
+                      's/^\(OIDENT_GROUP\)=.*/\1=proc/' \
+                      /etc/default/oidentd \
+        && /etc/init.d/oidentd restart
     fi
   fi
 }
@@ -459,25 +462,28 @@ upgrade_libc () {
 
 # upgrade apache -> apache2
 upgrade_apache () {
+
   # bugfix for apache2-cn postinst
   mkdir -p /etc/apache2
   touch /etc/apache2/httpd.conf
 
-  pkgadd php4-odbc php4-xslt
-
-  # apache2 conflicts with these
-  pkgrm apache aosi-aai aosi-www-aai php4-cn squirrelmail-cn
-
-  # apache2-cn postinst needs new mktemp
-  #pkgadd apache2-cn php5-cn aosi-aai aosi-www-aai # squirrelmail-cn
+  # temporary remove packages conflicting with apache2
+  delpkg=""
+  for p in aosi-aai aosi-www-aai \
+           php4-cn php4-odbc php4-xslt \
+           squirrelmail-cn; do
+     pkg p && delpkg="$delpkg $p"
+  done
+  eval pkgrm apache $delpkg
 
-  pkgadd apache2 apache2-mpm-prefork libapache2-mod-php4 ssl-cert
-  pkgadd apache2-cn php4-cn
-  pkgadd aosi-aai aosi-www-aai squirrelmail-cn
+  # install new packages
+  eval pkgadd apache2-cn apache2-mpm-prefork \
+              php4-cn libapache2-mod-php4 \
+              $delpkg
 }
 
 upgrade_amavis () {
-  # remove diversion
+  # remove init script diversion
   if [ -L /etc/init.d/amavis -a -f /etc/init.d/amavis.amavisd-new ]; then
     rm -f /etc/init.d/amavis
     dpkg-divert --quiet --remove /etc/init.d/amavis
@@ -489,12 +495,15 @@ upgrade_amavis () {
     mv $conf $conf.cn4-upgrade
   fi
 
+  # install new packages
   pkgadd amavisd-cn amavisd-new
 
+  # fix new packages
   check_and_sed '^clamd.*5.clamav.log$' \
                 's/^\(clamd.*\)5.clamav.log$/\14\tsocket/g' \
                 /etc/init.d/amavisd-cn || true
 
+  # start new packages
   /etc/init.d/amavis restart
 }