From 585066183f9be70f828dbac8bdefbeb623b3fe2a Mon Sep 17 00:00:00 2001 From: fgerlits Date: Sun, 28 Jan 2007 16:28:28 +0000 Subject: [PATCH] fix for #2138, first attempt --- campcaster/bin/user_setup.sh | 8 ++++++++ .../products/scheduler/bin/campcaster-scheduler.sh | 14 +++++++++++--- .../scheduler/bin/campcaster-scheduler_devenv.sh | 8 +++----- campcaster/src/products/scheduler/etc/Makefile.in | 4 ++++ .../scheduler/{bin => var/install}/install.php | 0 .../scheduler/{bin => var/install}/installInit.php | 0 .../{bin => var/install}/installScheduler.php | 0 .../scheduler/{bin => var/install}/uninstall.php | 0 .../{bin => var/install}/uninstallScheduler.php | 0 9 files changed, 26 insertions(+), 8 deletions(-) rename campcaster/src/products/scheduler/{bin => var/install}/install.php (100%) rename campcaster/src/products/scheduler/{bin => var/install}/installInit.php (100%) rename campcaster/src/products/scheduler/{bin => var/install}/installScheduler.php (100%) rename campcaster/src/products/scheduler/{bin => var/install}/uninstall.php (100%) rename campcaster/src/products/scheduler/{bin => var/install}/uninstallScheduler.php (100%) diff --git a/campcaster/bin/user_setup.sh b/campcaster/bin/user_setup.sh index f8d7dfd56..44998f1fd 100755 --- a/campcaster/bin/user_setup.sh +++ b/campcaster/bin/user_setup.sh @@ -326,6 +326,14 @@ make -C $modules_dir/storageServer storage || exit 1 make -C $modules_dir/archiveServer storage || exit 1 +#------------------------------------------------------------------------------- +# Setup the database tables for the scheduler +#------------------------------------------------------------------------------- +echo "Setting up database tables for the scheduler..." + +make -C $products_dir/scheduler init || exit 1 + + #------------------------------------------------------------------------------- # Setup directory permissions #------------------------------------------------------------------------------- diff --git a/campcaster/src/products/scheduler/bin/campcaster-scheduler.sh b/campcaster/src/products/scheduler/bin/campcaster-scheduler.sh index 03ca68dfb..f0ae6eaa2 100755 --- a/campcaster/src/products/scheduler/bin/campcaster-scheduler.sh +++ b/campcaster/src/products/scheduler/bin/campcaster-scheduler.sh @@ -38,6 +38,7 @@ basedir=`cd $reldir; pwd;` bindir=$basedir/bin etcdir=$basedir/etc libdir=$basedir/lib +vardir=$basedir/var/Campcaster/scheduler/var #------------------------------------------------------------------------------- @@ -46,7 +47,14 @@ libdir=$basedir/lib export LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH export GST_REGISTRY=$etcdir/gst-registry.xml scheduler_exe=$bindir/campcaster-scheduler -config_file=$etcdir/campcaster-scheduler.xml + +if [ -f ~/.campcaster/campcaster-scheduler.xml ]; then + config_file=~/.campcaster/campcaster-scheduler.xml +elif [ -f $etcdir/campcaster-scheduler.xml ]; then + config_file=$etcdir/campcaster-scheduler.xml +else + echo "Can't find configuration file."; +fi mode=$1 @@ -83,12 +91,12 @@ case "$mode" in 'install') echo "Installing Campcaster scheduler database tables..." - php install.php -c $config_file + php $vardir/install/install.php -c $config_file ;; 'uninstall') echo "Uninstalling Campcaster scheduler database tables..." - php uninstall.php -c $config_file + php $vardir/install/uninstall.php -c $config_file ;; 'kill') diff --git a/campcaster/src/products/scheduler/bin/campcaster-scheduler_devenv.sh b/campcaster/src/products/scheduler/bin/campcaster-scheduler_devenv.sh index fd90d7cd5..0e2123e63 100755 --- a/campcaster/src/products/scheduler/bin/campcaster-scheduler_devenv.sh +++ b/campcaster/src/products/scheduler/bin/campcaster-scheduler_devenv.sh @@ -40,6 +40,7 @@ bindir=$basedir/bin etcdir=$basedir/etc libdir=$basedir/lib tmpdir=$basedir/tmp +vardir=$basedir/var usrdir=`cd $basedir/../../../usr; pwd;` @@ -67,9 +68,6 @@ fi mode=$1 -#echo "Using scheduler: $scheduler_exe"; -#echo " configuration file: $config_file"; - #------------------------------------------------------------------------------- # Do what the user asks us to do @@ -109,12 +107,12 @@ case "$mode" in 'install') echo "Installing Campcaster scheduler database tables..." - $scheduler_exe -c $config_file install + php $vardir/install/install.php -c $config_file ;; 'uninstall') echo "Uninstalling Campcaster scheduler database tables..." - $scheduler_exe -c $config_file uninstall + php $vardir/install/uninstall.php -c $config_file ;; 'kill') diff --git a/campcaster/src/products/scheduler/etc/Makefile.in b/campcaster/src/products/scheduler/etc/Makefile.in index d6d1f2d3d..fa1343092 100644 --- a/campcaster/src/products/scheduler/etc/Makefile.in +++ b/campcaster/src/products/scheduler/etc/Makefile.in @@ -51,6 +51,7 @@ COVERAGE_DIR = ${DOC_DIR}/coverage BIN_DIR = ${BASE_DIR}/bin ETC_DIR = ${BASE_DIR}/etc SRC_DIR = ${BASE_DIR}/src +VAR_DIR = ${BASE_DIR}/var TMP_DIR = ${BASE_DIR}/tmp REAL_BASE_DIR=$(shell cd ${BASE_DIR}; pwd) @@ -63,6 +64,7 @@ USR_BIN_DIR = ${USR_DIR}/bin USR_ETC_DIR = ${USR_DIR}/etc USR_INCLUDE_DIR = ${USR_DIR}/include USR_LIB_DIR = ${USR_DIR}/lib +USR_VAR_DIR = ${USR_DIR}/var/Campcaster/scheduler/var USR_TMP_DIR = ${USR_DIR}/tmp STORAGE_TMP_DIR = "/tmp" @@ -354,6 +356,7 @@ copy_files: ${MAKE} -C ${EVENT_SCHEDULER_DIR} install ${MKDIR} ${USR_BIN_DIR} ${MKDIR} ${USR_ETC_DIR} + ${MKDIR} ${USR_VAR_DIR}/install ${MKDIR} ${USR_TMP_DIR} ${CP} ${BIN_DIR}/campcaster-scheduler.sh ${USR_BIN_DIR} ${CP} ${SCHEDULER_EXE} ${USR_BIN_DIR} @@ -367,6 +370,7 @@ copy_files: ${CAT} ${ETC_DIR}/campcaster-scheduler.xml.template \ | ${SED} -e ${REPLACE_SED_STRING} \ > ${USR_ETC_DIR}/campcaster-scheduler.xml + ${CP} ${VAR_DIR}/install/*.php ${USR_VAR_DIR}/install/ create_database: ifeq (@CREATE_LS_DATABASE@,yes) diff --git a/campcaster/src/products/scheduler/bin/install.php b/campcaster/src/products/scheduler/var/install/install.php similarity index 100% rename from campcaster/src/products/scheduler/bin/install.php rename to campcaster/src/products/scheduler/var/install/install.php diff --git a/campcaster/src/products/scheduler/bin/installInit.php b/campcaster/src/products/scheduler/var/install/installInit.php similarity index 100% rename from campcaster/src/products/scheduler/bin/installInit.php rename to campcaster/src/products/scheduler/var/install/installInit.php diff --git a/campcaster/src/products/scheduler/bin/installScheduler.php b/campcaster/src/products/scheduler/var/install/installScheduler.php similarity index 100% rename from campcaster/src/products/scheduler/bin/installScheduler.php rename to campcaster/src/products/scheduler/var/install/installScheduler.php diff --git a/campcaster/src/products/scheduler/bin/uninstall.php b/campcaster/src/products/scheduler/var/install/uninstall.php similarity index 100% rename from campcaster/src/products/scheduler/bin/uninstall.php rename to campcaster/src/products/scheduler/var/install/uninstall.php diff --git a/campcaster/src/products/scheduler/bin/uninstallScheduler.php b/campcaster/src/products/scheduler/var/install/uninstallScheduler.php similarity index 100% rename from campcaster/src/products/scheduler/bin/uninstallScheduler.php rename to campcaster/src/products/scheduler/var/install/uninstallScheduler.php