Scalix Update 11.x: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 38: | Zeile 38: | ||
</pre> | </pre> | ||
Das Update-Script '''scx-update.sh''' | Das Update-Script '''scx-update.sh''' habe ich unter '''/usr/src''' liegen, da ich dort auch die verschiedenen scalix-sourcen installiert habe: | ||
<pre>scx:/usr/src# ls | <pre>scx:/usr/src# ls | ||
scalix-11.3.0-U1-GA-unsupported-debian-intel.bin | scalix-11.3.0-U1-GA-unsupported-debian-intel.bin | ||
| Zeile 53: | Zeile 53: | ||
<pre> | <pre> | ||
#!/bin/sh | #!/bin/sh | ||
# | # Scalix 11.x update script | ||
# Author: neobiker | |||
# Version: $Id: scx-update.sh,v 1.1 2008/07/20 16:56:45 root Exp root $ | |||
usage () | |||
{ | |||
cat << EOF | |||
Usage: $0 [-c|-i] # update scalix packages with: dpkg -i -E <package> | |||
Options are: | |||
-c configure scalix, don't update/install packages | |||
-i (re-)install scalix packages with: dpkg -i <package> | |||
EOF | |||
exit 0 | |||
} | |||
# Initialise some settings | # Initialise some settings | ||
| Zeile 63: | Zeile 78: | ||
web_apps="swa sac mobile platform" | web_apps="swa sac mobile platform" | ||
for f in ${main_progs}; do | if [ `ls -1 scalix-*.deb 2>/dev/null | wc -l` -gt 0 ] ; then | ||
for f in ${main_progs}; do | |||
main_files="${main_files} "`ls scalix-${f}*.deb` | |||
dropme="${dropme} | grep -v $f" | |||
done | |||
for f in ${web_apps}; do | for f in ${web_apps}; do | ||
web_files="${web_files} "`ls scalix-${f}*.deb` | web_files="${web_files} "`ls scalix-${f}*.deb` | ||
| Zeile 97: | Zeile 112: | ||
{ | { | ||
echo "Updating Scalix Server" | echo "Updating Scalix Server" | ||
dpkg -i | dpkg -i $opt_update ${main_files} | ||
dpkg -i | dpkg -i $opt_update ${other_files} | ||
echo "" | echo "" | ||
| Zeile 115: | Zeile 130: | ||
} | } | ||
# | # configure scalix | ||
scx_configure () | |||
{ | { | ||
echo "Scalix configuration:" | echo "Scalix configuration:" | ||
| Zeile 168: | Zeile 183: | ||
fi | fi | ||
echo "Scalix | echo "Scalix configuration done." | ||
} | } | ||
| Zeile 181: | Zeile 196: | ||
} | } | ||
# show differences to new config files | |||
scx_diff_config () | scx_diff_config () | ||
{ | { | ||
| Zeile 196: | Zeile 212: | ||
echo "-------------------------------------------------" | echo "-------------------------------------------------" | ||
echo "Check changes in ${file}:" | echo "Check changes in ${file}:" | ||
diff ${file}.old ${file}.new | diff ${file}.old ${file}.new | ||
echo ">>> Restore old Configfile [y] ?" | echo ">>> Restore old Configfile [y] ?" | ||
read a | read a | ||
if [ -z "$a" -o "$a" == "y" -o "$a" == "Y" ]; then | if [ -z "$a" -o "$a" == "y" -o "$a" == "Y" ]; then | ||
cp ${file} ${file}.new.update | cp ${file} ${file}.new.update | ||
| Zeile 212: | Zeile 231: | ||
echo ">>> Remove temp. Backupfiles (${base}/scalix-config-backup-${pid}) [y] ?" | echo ">>> Remove temp. Backupfiles (${base}/scalix-config-backup-${pid}) [y] ?" | ||
read a | read a | ||
if [ -z "$a" -o "$a" == "y" -o "$a" == "Y" ]; then | if [ -z "$a" -o "$a" == "y" -o "$a" == "Y" ]; then | ||
rm -rf ${base}/scalix-config-backup-${pid} | rm -rf ${base}/scalix-config-backup-${pid} | ||
| Zeile 231: | Zeile 251: | ||
dpkg -I $1 | awk '/Package/ {print $2}' | dpkg -I $1 | awk '/Package/ {print $2}' | ||
} | } | ||
# set script options | |||
opt_update="-E" | |||
while getopts "chi" option | |||
do | |||
case $option in | |||
c) opt_configure=1 | |||
;; | |||
h) usage | |||
;; | |||
i) opt_update="" | |||
;; | |||
*) usage | |||
;; | |||
esac | |||
done | |||
# Update scalix pakages: | # Update scalix pakages: | ||
| Zeile 239: | Zeile 276: | ||
scx_initvars | scx_initvars | ||
scx_backup_config | scx_backup_config | ||
scx_update | [ -z "$opt_configure" ] && scx_update | ||
scx_configure | |||
scx_diff_config | scx_diff_config | ||
scx_restart | scx_restart | ||
</pre> | </pre> | ||
Das Skript konfiguriert Scalix, z.B. nach einem update, da die Konfig-Files beim Update überschrieben werden. | |||
<pre> | <pre> | ||
cd scalix-debian-11.4.0-GA/software/scalix_server | |||
/usr/src/scx-update.sh -c | |||
</pre> | </pre> | ||
Version vom 20. Juli 2008, 17:59 Uhr
Scalix Update
Scalix Sourcen laden und updaten.
scx:~# cd /usr/src wget -c http://downloads.scalix.com/.community/11.4/scalix-11.4.0-GA-unsupported-debian-intel.bin sh ./scalix-11.4.0-GA-unsupported-debian-intel.bin cd scalix-debian-11.4.0-GA/software/scalix_server /usr/src/scx-update.sh
In Version 11.4 war (mal wieder) ein Deb-Paket (leicht) fehlerhaft, ich zeige hier beispielhaft, wie solche Fehler korrigiert werden können. Nach Fehlerbereinigung einfach das Paket entfernen und neu installieren.
scx:/usr/src# cd scalix-debian-11.4.0-GA/software/scalix_server/
mkdir -p old new/DEBIAN
mv scalix-iconv-extras_1.2-1_i386.deb old
dpkg -x old/scalix-iconv-extras_1.2-1_i386.deb new
dpkg -e old/scalix-iconv-extras_1.2-1_i386.deb new/DEBIAN
vi new/DEBIAN/preinst
# ... Zeile 3 korrigieren
if [ -n "$1" ]; then
# ...
vi new/DEBIAN/postrm
# ... Zeile 2 korrigieren
if [ -z "$1" ]; then
# ...
# Jetzt das korrigierte Paket bauen
dpkg -b new scalix-iconv-extras_1.2-1_i386.deb
# Fertig :-)
dpkg -r scalix-iconv-extras
dpkg -i scalix-iconv-extras_1.2-1_i386.deb
Das Update-Script scx-update.sh habe ich unter /usr/src liegen, da ich dort auch die verschiedenen scalix-sourcen installiert habe:
scx:/usr/src# ls scalix-11.3.0-U1-GA-unsupported-debian-intel.bin scalix-11.4.0-GA-unsupported-debian-intel.bin scalix-debian-11.3.0-GA/ scalix-debian-11.4.0-GA/ scx-install.sh* scx-reconfigure.sh* scx-update.sh*
Hier ist das Scalix Update-Script. /usr/src/scx-update.sh
#!/bin/sh
# Scalix 11.x update script
# Author: neobiker
# Version: $Id: scx-update.sh,v 1.1 2008/07/20 16:56:45 root Exp root $
usage ()
{
cat << EOF
Usage: $0 [-c|-i] # update scalix packages with: dpkg -i -E <package>
Options are:
-c configure scalix, don't update/install packages
-i (re-)install scalix packages with: dpkg -i <package>
EOF
exit 0
}
# Initialise some settings
# get scalix pakage filenames: main_files, web_files, other_files
# define config files etc.
scx_initvars ()
{
main_progs="server postgres tomcat- tomcat_"
web_apps="swa sac mobile platform"
if [ `ls -1 scalix-*.deb 2>/dev/null | wc -l` -gt 0 ] ; then
for f in ${main_progs}; do
main_files="${main_files} "`ls scalix-${f}*.deb`
dropme="${dropme} | grep -v $f"
done
for f in ${web_apps}; do
web_files="${web_files} "`ls scalix-${f}*.deb`
dropme="${dropme} | grep -v $f"
done
other_files=`eval "ls -1 scalix-*.deb ${dropme}"`
pid=$$
host=$(hostname)
fqdn=$(hostname -f)
short=${host:0:1}${host: -1:1}
base=/var/opt/scalix/${short}
config_files="${base}/webmail/swa.properties \
${base}/caa/scalix.res/config/ubermanager.properties \
${base}/res/config/res.properties \
${base}/platform/platform.properties \
${base}/mobile/mobile.properties \
${base}/sis/sis.properties"
else
echo 'Sorry, no scalix-\*.deb pakages found.'
echo "Please change to the directory which contains the files and try again."
exit 1
fi
}
scx_update ()
{
echo "Updating Scalix Server"
dpkg -i $opt_update ${main_files}
dpkg -i $opt_update ${other_files}
echo ""
echo "Reinstalling Scalix Webapplications:"
for file in ${web_files}; do
pkg=`scx_pkgname ${file}`
echo "updating ${pkg}: ${file}"
dpkg -r ${pkg}
if ! dpkg -i ${file} ; then
echo ">>> Warning: dpkg returned an error. <<<"
echo ""
fi
done
echo "Scalix Configuration files must be reconfigured."
}
# configure scalix
scx_configure ()
{
echo "Scalix configuration:"
echo "---------------------"
echo "Scalix Password ? "
read geheim
dbpwd=$geheim
ldappwd=$geheim
tomcatport=80
for file in ${config_files}; do
sed -e "s;%LOCALDOMAIN%;$ldomain;g" \
-e "s;%LOCALHOST%;$fqdn;g" \
-e "s;%IMAPHOST%;$fqdn;g" \
-e "s;%SMTPHOST%;$fqdn;g" \
-e "s;%DBHOST%;$fqdn:5733;g" \
-e "s;%DBPASSWD%;$dbpwd;g" \
-e "s;%LDAPPORT%;389;g" \
-e "s;http://%PLATFORMURL%:8080/api;http://$fqdn/api;g" \
-e "s;%PLATFORMURL%;http://$fqdn/api;g" \
-e "s;swa.platform.enabled=false;swa.platform.enabled=true;g" \
-e "s;__SECURED_MODE__;false;g" \
-e "s;ubermanager/__FQHN_HOST__@__KERBEROS_REALM__;;g" \
-e "s;__KERBEROS_REALM__;;g" \
-e "s;__FQHN_FOR_KDC_HOST__;;g" \
-e "s;__FQHN_QUERY_SERVER_NAME__;$fqdn;g" \
-e "s;__UBERMGR_USE_EXTERNAL_AUTH__;false;g" \
-e "s;__UBERMGR_ALLOW_EXTERNAL_AUTH__;false;g" \
-e "s;__UBERMGR_MAXLIST_SIZE__;100;g" \
-e "s;__UBERMGR_MAIL_DOMAINS_LIST__;$ldomain;g" \
-e "s;__UBERMGR_EXTERNAL_DOMAIN_AUTH_LIST__;;g" \
-e "s;__CONFIGURED__;true;g" \
-e "s;__FQHN_FOR_UBERMANAGER__;$fqdn;g" \
-e "s;__TOMCAT_PORT__;$tomcatport;g" \
-e "s;localhost;$fqdn;g" \
-e "s;%SIS-LANGUAGE%;German;g" \
-e "s;%INDEX-WHITELIST%;$fqdn;g" \
-e "s;%SEARCH-WHITELIST%;$fqdn;g" \
${file} > ${file}.new
mv $file.new $file
done
# If SAC Login doesn't work, try this
# Write Ldappassword to psdata
if [ ! -e ${base}/caa/scalix.res/config/psdata ]; then
echo "${ldappwd}" > ${base}/caa/scalix.res/config/psdata
chown root:root ${base}/caa/scalix.res/config/psdata
chmod 400 ${base}/caa/scalix.res/config/psdata
fi
echo "Scalix configuration done."
}
# backup scalix config files
scx_backup_config ()
{
for f in ${config_files}; do
mkdir -p `dirname ${base}/scalix-config-backup-${pid}${f}`
cp ${f} ${base}/scalix-config-backup-${pid}${f}
cp ${f} ${f}.bak
done
}
# show differences to new config files
scx_diff_config ()
{
for file in ${config_files}; do
sed -e 's/#.*//g' \
-e '/^$/ D' \
${file} | sort > ${file}.new
sed -e 's/#.*//g' \
-e '/^$/ D' \
${base}/scalix-config-backup-${pid}${file} | sort > ${file}.old
if ! diff -q ${file}.old ${file}.new; then
echo "-------------------------------------------------"
echo "Check changes in ${file}:"
diff ${file}.old ${file}.new
echo ">>> Restore old Configfile [y] ?"
read a
if [ -z "$a" -o "$a" == "y" -o "$a" == "Y" ]; then
cp ${file} ${file}.new.update
cp ${base}/scalix-config-backup-${pid}${file} ${file}
echo "restored ${file} !!! <<<"
fi
echo "-------------------------------------------------"
echo ""
fi
done
echo ">>> Remove temp. Backupfiles (${base}/scalix-config-backup-${pid}) [y] ?"
read a
if [ -z "$a" -o "$a" == "y" -o "$a" == "Y" ]; then
rm -rf ${base}/scalix-config-backup-${pid}
echo "${base}/scalix-config-backup-${pid} deleted"
fi
}
scx_restart ()
{
echo "Scalix restart..."
for f in /etc/rc1.d/K*scalix*; do $f stop; done
for f in /etc/rc2.d/S*scalix*; do $f start; done
echo "Scalix restarted."
}
# get pakage name (used by dpkg -r <package>)
scx_pkgname ()
{
dpkg -I $1 | awk '/Package/ {print $2}'
}
# set script options
opt_update="-E"
while getopts "chi" option
do
case $option in
c) opt_configure=1
;;
h) usage
;;
i) opt_update=""
;;
*) usage
;;
esac
done
# Update scalix pakages:
# backup config-files
# update scalix pakages: Web applications need 'remove' first
# reconfigure scalix
scx_initvars
scx_backup_config
[ -z "$opt_configure" ] && scx_update
scx_configure
scx_diff_config
scx_restart
Das Skript konfiguriert Scalix, z.B. nach einem update, da die Konfig-Files beim Update überschrieben werden.
cd scalix-debian-11.4.0-GA/software/scalix_server /usr/src/scx-update.sh -c