Update of /cvsroot/monetdb/MonetDB5/src/tools
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22040
Modified Files:
Makefile.ag mrecover mserver5.mx.in
Added Files:
mcheckpoint
Removed Files:
mchkpnt
Log Message:
Make sure that the debug option becomes visible in the environment table.
Rename, it does not make sense to save a few characters in the name.
--- mchkpnt DELETED ---
Index: Makefile.ag
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/tools/Makefile.ag,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- Makefile.ag 17 Aug 2007 21:09:51 -0000 1.46
+++ Makefile.ag 30 Aug 2007 20:38:41 -0000 1.47
@@ -67,7 +67,7 @@
scripts_sh = {
EXT = ""
DIR = bindir
- SOURCES = monetdb5-config.in mchkpnt mrecover
+ SOURCES = monetdb5-config.in mcheckpoint mrecover
}
scripts_bat = {
Index: mrecover
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/tools/mrecover,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- mrecover 22 Aug 2007 06:21:56 -0000 1.12
+++ mrecover 30 Aug 2007 20:38:42 -0000 1.13
@@ -23,7 +23,7 @@
echo " --dbname=<database_name>"
echo " --ascii=<yes/no> default no"
echo " --tool=<mapi/jdbc> default mapi"
- echo " --chkpnt=<directory>"
+ echo " --dir=<directory>"
echo " --help"
exit 0
}
@@ -102,8 +102,8 @@
--dbname=*)
DBNAME="${1#--dbname=}"
;;
- --chkpnt=*)
- CHKPNTDIR="${1#--chkpnt=}"
+ --dir=*)
+ CHKPNTDIR="${1#--dir=}"
;;
--tag=*)
TAG="${1#--tag=}"
--- NEW FILE: mcheckpoint ---
#!/bin/bash
# The contents of this file are subject to the MonetDB Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the MonetDB Database System.
#
# The Initial Developer of the Original Code is CWI.
# Portions created by CWI are Copyright (C) 1997-2007 CWI.
# All Rights Reserved.
#See the MonetDB Version 5 documentation for details
function usage()
{
echo "Usage: mcheckpoint [options] "
echo " --dbname=<database_name>"
echo " --ascii=<yes/no> default no"
echo " --tool=<mapi/jdbc> default mapi"
echo " --dir=<directory>"
echo " --help"
exit 0
}
function diefunc() {
local linenr="$1" exitnr="$2"
shift 2
echo >&2
echo "A fatal error detected at line ${linenr}!" >&2
echo -e "${*:-(no error message given)}" >&2
echo "Exit state: ${exitnr}" >&2
echo "Please check your configuration and try again" >&2
exit 1
}
# must set this option, else script will not expand aliases
shopt -s expand_aliases
alias die='diefunc "$LINENO" "$?"'
case "$1" in
--help)
usage
;;
esac
DBFARM=$MONETDB5_PREFIX/var/MonetDB5/dbfarm
DBLOGS=$MONETDB5_PREFIX/var/MonetDB5/dblogs
CHKPNTDIR=$MONETDB5_PREFIX/var/MonetDB5/chkpnt
TAG=`date +%F-%H%M%S`
# First perform some sanity checks
[[ -z "$MONETDB5_PREFIX" ]] && die \
"The MONETDB5_PREFIX environment variable has not been set.\n\
It should point to where you have installed the build directory"
# start the checkpoint process.
[[ -d $DBFARM ]] || die "Database storage area '$DBFARM' is not accessible"
# massage the argument list to prepare for calling
DBNAME=""
ASCII="no"
TOOL="mclient -lsql"
while [ $# -gt 0 ];
do
case "$1" in
--help)
usage
;;
--ascii=*)
ASCII="${1#--ascii=}"
case "$ASCII" in
[Yy][Ee][Ss]|[Yy])
ASCII="yes"
;;
[Nn][Oo]|[Nn])
ASCII="no"
;;
*)
die "--ascii: '$ASCII' not understood, use 'yes' or
'no'"
;;
esac
;;
--tool=*)
TOOL=${1%Client}
TOOL=${TOOL#--tool=}
case "$TOOL" in
[Mm]api)
TOOL="mclient -lsql"
;;
[Jj][Dd][Bb][Cc])
TOOL="JdbcClient"
;;
*)
die "--tool: '${1#--tool=}' not understood, use
'mapi' or 'jdbc'"
esac
;;
--dbname=*)
DBNAME="${1#--dbname=}"
;;
--dir=*)
CHKPNTDIR="${1#--dir=}"
;;
--tag=*)
TAG="${1#--tag=}"
;;
*)
usage
;;
esac
shift
done
[[ -z "$DBNAME" ]] && die "Database name missing"
[[ -d "$DBFARM/$DBNAME" ]] || die "Database '$DBNAME' missing"
if [ ! -d $CHKPNTDIR ]
then
mkdir -p $CHKPNTDIR
fi
[[ -d $CHKPNTDIR ]] || die "Checkpoint directory '$CHKPNTDIR' not available"
if [ ! -d "$CHKPNTDIR/$DBNAME" ]
then
mkdir -p "$CHKPNTDIR/$DBNAME"
fi
[[ -d "$CHKPNTDIR/$DBNAME" ]] || die "Database checkpoint directory
'$CHKPNTDIR/$DBNAME' is not accessible"
CHKPFILE="$CHKPNTDIR/$DBNAME/$TAG"
LOGFILE="$CHKPNTDIR/$DBNAME/$TAG-logs"
[[ -f $CHKPFILE ]] && die "Checkpoint file '$CHKPFILE' already exist"
[[ -f $LOGFILE ]] && die "Checkpoint log file '$LOGFILE' already exist"
# Ready for preparing the checkpoint
cd $DBFARM
echo "Checkpoint store $CHKPNTDIR"
echo "Preparing checkpoint file '$DBNAME/$TAG'"
if [ "$ASCII" == "yes" ];
then
monetdb --start --dbname=$DBNAME || die "failed to start Mserver"
sleep 2
$TOOL --dump > ${CHKPFILE}.sql || die "Creation of dump failed"
gzip ${CHKPFILE}.sql || die "Compression of dump file failed"
else
tar -cf ${CHKPFILE}.tar $DBNAME || die "Creation of checkpoint file
failed"
gzip ${CHKPFILE}.tar || die "Compression of checkpoint file failed"
fi
cd $DBLOGS
echo "Preparing checkpoint log file '$DBNAME/$TAG-logs'"
[[ -d "$DBNAME" ]] || die "No log directory available for '$DBNAME'"
tar -cf ${LOGFILE}.tar $DBNAME || die "Creation of checkpoint log file failed"
gzip ${LOGFILE}.tar || die "Compression of checkpoint log file failed"
echo "Database checkpoint finished"
Index: mserver5.mx.in
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/tools/mserver5.mx.in,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- mserver5.mx.in 29 Aug 2007 14:12:21 -0000 1.32
+++ mserver5.mx.in 30 Aug 2007 20:38:42 -0000 1.33
@@ -555,7 +555,13 @@
mo_print_options(set, setlen);
if (monet_init(set, setlen) == 0 )
return 0;
- GDKdebug=debug; /* overruled by command line */
+ /* propagate the debug flag to the environment table */
+ if( debug){
+ char buf[BUFSIZ];
+ snprintf(buf,BUFSIZ,"%d",debug);
+ GDKsetenv("gdk_debug", buf);
+ GDKdebug=debug; /* overruled by command line */
+ }
GDKsetenv("monet_version", VERSION);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins