another attempt at fixing #2101

This commit is contained in:
fgerlits 2007-02-06 18:06:34 +00:00
parent 37694dc331
commit c643b6087b
3 changed files with 17 additions and 27 deletions

View File

@ -21,23 +21,18 @@ installdir=/opt/campcaster
case "$1" in case "$1" in
configure) configure)
if [ -f $installdir/storageServer.wasMounted ]; then
storagedir=$installdir/var/Campcaster/storageServer
if [ -d $storagedir.bak ]; then
rm -rf $storagedir.bak
fi
mv -f $storagedir $storagedir.bak
mkdir $storagedir
mount $storagedir
rm $installdir/storageServer.wasMounted
fi
# do post-installation configuration # do post-installation configuration
$installdir/bin/postInstallStation.sh --directory=$installdir \ $installdir/bin/postInstallStation.sh --directory=$installdir \
--apache-group=www-data \ --apache-group=www-data \
--postgresql-dir=/etc/postgresql/8.1/main \ --postgresql-dir=/etc/postgresql/8.1/main \
--postgresql-init-script=/etc/init.d/postgresql-8.1 --postgresql-init-script=/etc/init.d/postgresql-8.1
# remount the NFS share if we have a 2-computer setup
if [ -f $installdir/storageServer.wasMounted ]; then
mount $installdir/var/Campcaster/storageServer
rm $installdir/storageServer.wasMounted
fi
# register and start the Campcaster scheduler daemon # register and start the Campcaster scheduler daemon
cp -f $installdir/etc/campcaster-scheduler /etc/init.d cp -f $installdir/etc/campcaster-scheduler /etc/init.d
update-rc.d campcaster-scheduler defaults 92 || true update-rc.d campcaster-scheduler defaults 92 || true

View File

@ -68,13 +68,8 @@ case "$1" in
# remove generated files # remove generated files
rm -rf $installdir/var/Campcaster/archiveServer/var/stor/* rm -rf $installdir/var/Campcaster/archiveServer/var/stor/*
rm -rf $installdir/var/Campcaster/storageServer/var/stor/*
storagedir=$installdir/var/Campcaster/storageServer rm -f $installdir/storageServer.wasMounted
if [ -f $installdir/storageServer.wasMounted ]; then
rmdir $storagedir
else
rm -rf $storagedir/var/stor/*
fi
;; ;;
*) *)

View File

@ -45,6 +45,13 @@ check_exe() {
case "$1" in case "$1" in
remove|upgrade|deconfigure) remove|upgrade|deconfigure)
# unmount the NFS share, if we have a 2-computer setup
storagedir=$installdir/var/Campcaster/storageServer
if [ "`mount | grep -o \"on $storagedir \"`" = "on $storagedir " ]; then
umount $storagedir
touch $installdir/storageServer.wasMounted
fi
# stop the livesupport scheduler daemon # stop the livesupport scheduler daemon
/etc/init.d/campcaster-scheduler stop || true /etc/init.d/campcaster-scheduler stop || true
/etc/init.d/campcaster-scheduler kill || true /etc/init.d/campcaster-scheduler kill || true
@ -78,15 +85,8 @@ case "$1" in
rm -rf $installdir/var/Campcaster/htmlUI/var/templates_c/* rm -rf $installdir/var/Campcaster/htmlUI/var/templates_c/*
rm -rf $installdir/var/Campcaster/archiveServer/var/access/* rm -rf $installdir/var/Campcaster/archiveServer/var/access/*
rm -rf $installdir/var/Campcaster/archiveServer/var/trans/* rm -rf $installdir/var/Campcaster/archiveServer/var/trans/*
rm -rf $installdir/var/Campcaster/storageServer/var/access/*
storagedir=$installdir/var/Campcaster/storageServer rm -rf $installdir/var/Campcaster/storageServer/var/trans/*
if [ "`mount | grep -o \"on $storagedir \"`" = "on $storagedir " ]; then
umount $storagedir
touch $installdir/storageServer.wasMounted
else
rm -rf $storagedir/var/access/*
rm -rf $storagedir/var/trans/*
fi
;; ;;
failed-upgrade) failed-upgrade)