possible fix for #2101

This commit is contained in:
fgerlits 2007-01-17 16:07:56 +00:00
parent 9cc129a89d
commit 1a35e8d6b8
4 changed files with 73 additions and 27 deletions

View file

@ -282,6 +282,17 @@ ${install_bin}/createOdbcDataSource.sh --database=${ls_database} \
--dbserver=${ls_dbserver} --dbserver=${ls_dbserver}
#-------------------------------------------------------------------------------
# Check whether the storage server directory has been replaced with a mount
# point for an NFS share.
#-------------------------------------------------------------------------------
storagedir=$installdir/var/storageServer
storage_is_local=yes
if [ "`mount | grep -o \"on $storagedir \"`" = "on $storagedir " ]; then
storage_is_local=no
fi
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Setup directory permissions # Setup directory permissions
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -297,15 +308,17 @@ chmod g+sw $install_var_ls/archiveServer/var/access
chmod g+sw $install_var_ls/archiveServer/var/trans chmod g+sw $install_var_ls/archiveServer/var/trans
chmod g+sw $install_var_ls/archiveServer/var/stor/buffer chmod g+sw $install_var_ls/archiveServer/var/stor/buffer
chgrp $apache_group $install_var_ls/storageServer/var/stor if [ "$storage_is_local" = "yes" ]; then
chgrp $apache_group $install_var_ls/storageServer/var/access chgrp $apache_group $install_var_ls/storageServer/var/stor
chgrp $apache_group $install_var_ls/storageServer/var/trans chgrp $apache_group $install_var_ls/storageServer/var/access
chgrp $apache_group $install_var_ls/storageServer/var/stor/buffer chgrp $apache_group $install_var_ls/storageServer/var/trans
chgrp $apache_group $install_var_ls/storageServer/var/stor/buffer
chmod g+sw $install_var_ls/storageServer/var/stor chmod g+sw $install_var_ls/storageServer/var/stor
chmod g+sw $install_var_ls/storageServer/var/access chmod g+sw $install_var_ls/storageServer/var/access
chmod g+sw $install_var_ls/storageServer/var/trans chmod g+sw $install_var_ls/storageServer/var/trans
chmod g+sw $install_var_ls/storageServer/var/stor/buffer chmod g+sw $install_var_ls/storageServer/var/stor/buffer
fi
chgrp $apache_group $install_var_ls/htmlUI/var/templates_c chgrp $apache_group $install_var_ls/htmlUI/var/templates_c
chgrp $apache_group $install_var_ls/htmlUI/var/html/img chgrp $apache_group $install_var_ls/htmlUI/var/html/img
@ -379,12 +392,14 @@ ln -s $install_var_ls $www_root/campcaster
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
echo "Initializing database..."; echo "Initializing database...";
# create PHP-related database tables if [ "$storage_is_local" = "yes" ]; then
cd $install_var_ls/storageServer/var/install # create PHP-related database tables
# workaround for ticket #2059; restore to "exit 1" after the ticket is closed cd $install_var_ls/storageServer/var/install
#php -q install.php || exit 1; # workaround for #2059; restore to "exit 1" after the ticket is closed
php -q install.php || true #php -q install.php || exit 1;
cd - php -q install.php || true
cd -
fi
# create PHP-related database tables # create PHP-related database tables
cd $install_var_ls/archiveServer/var/install cd $install_var_ls/archiveServer/var/install
@ -416,13 +431,15 @@ $install_bin/gst-register
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Generate a random password for the scheduler's access to the storage # Generate a random password for the scheduler's access to the storage
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
grep -q 'ls_scheduler_storage_pass' $install_etc/campcaster-scheduler.xml if [ "$storage_is_local" = "yes" ]; then
if [ $? = 0 ]; then grep -q 'ls_scheduler_storage_pass' $install_etc/campcaster-scheduler.xml
SCHEDULER_STORAGE_PASS=`pwgen -N1 -c -n -s` if [ $? = 0 ]; then
php -q $install_var_ls/storageServer/var/changeSchedulerPassword.php \ SCHEDULER_STORAGE_PASS=`pwgen -N1 -c -n -s`
${SCHEDULER_STORAGE_PASS} php -q $install_var_ls/storageServer/var/changeSchedulerPassword.php \
sed -i -e "s/ls_scheduler_storage_pass/${SCHEDULER_STORAGE_PASS}/" \ ${SCHEDULER_STORAGE_PASS}
$install_etc/campcaster-scheduler.xml sed -i -e "s/ls_scheduler_storage_pass/${SCHEDULER_STORAGE_PASS}/" \
$install_etc/campcaster-scheduler.xml
fi
fi fi

View file

@ -199,6 +199,17 @@ echo "Removing symlinks...";
rm -f $www_root/campcaster rm -f $www_root/campcaster
#-------------------------------------------------------------------------------
# Check whether the storage server directory has been replaced with a mount
# point for an NFS share.
#-------------------------------------------------------------------------------
storagedir=$installdir/var/storageServer
storage_is_local=yes
if [ "`mount | grep -o \"on $storagedir \"`" = "on $storagedir " ]; then
storage_is_local=no
fi
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Delete data files # Delete data files
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -206,9 +217,11 @@ echo "Deleting data files...";
rm -rf $installdir/var/htmlUI/var/html/img/* rm -rf $installdir/var/htmlUI/var/html/img/*
rm -rf $installdir/var/htmlUI/var/templates_c/* rm -rf $installdir/var/htmlUI/var/templates_c/*
rm -rf $installdir/var/storageServer/var/stor/* if [ "$storage_is_local" = "yes" ]; then
rm -rf $installdir/var/storageServer/var/access/* rm -rf $installdir/var/storageServer/var/stor/*
rm -rf $installdir/var/storageServer/var/trans/* rm -rf $installdir/var/storageServer/var/access/*
rm -rf $installdir/var/storageServer/var/trans/*
fi
rm -rf $installdir/var/archiveServer/var/stor/* rm -rf $installdir/var/archiveServer/var/stor/*
rm -rf $installdir/var/archiveServer/var/access/* rm -rf $installdir/var/archiveServer/var/access/*
rm -rf $installdir/var/archiveServer/var/trans/* rm -rf $installdir/var/archiveServer/var/trans/*

View file

@ -67,8 +67,16 @@ case "$1" in
fi fi
# remove generated files # remove generated files
rm -rf $installdir/var/Campcaster/storageServer/var/stor/*
rm -rf $installdir/var/Campcaster/archiveServer/var/stor/* rm -rf $installdir/var/Campcaster/archiveServer/var/stor/*
storagedir=$installdir/var/Campcaster/storageServer
storage_is_local=yes
if [ "`mount | grep -o \"on $storagedir \"`" = "on $storagedir " ]; then
storage_is_local=no
fi
if [ "$storage_is_local" = "yes" ]; then
rm -rf $storagedir/var/stor/*
fi
;; ;;
*) *)

View file

@ -76,10 +76,18 @@ case "$1" in
rm -rf $installdir/etc/pear.conf rm -rf $installdir/etc/pear.conf
rm -rf $installdir/var/Campcaster/htmlUI/var/html/img/* rm -rf $installdir/var/Campcaster/htmlUI/var/html/img/*
rm -rf $installdir/var/Campcaster/htmlUI/var/templates_c/* rm -rf $installdir/var/Campcaster/htmlUI/var/templates_c/*
rm -rf $installdir/var/Campcaster/storageServer/var/access/*
rm -rf $installdir/var/Campcaster/storageServer/var/trans/*
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/*
storagedir=$installdir/var/Campcaster/storageServer
storage_is_local=yes
if [ "`mount | grep -o \"on $storagedir \"`" = "on $storagedir " ]; then
storage_is_local=no
fi
if [ "$storage_is_local" = "yes" ]; then
rm -rf $storagedir/var/access/*
rm -rf $storagedir/var/trans/*
fi
;; ;;
failed-upgrade) failed-upgrade)