added debug option

git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@419663 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
William Au 2006-07-06 19:14:40 +00:00
parent 9561be65e8
commit 9e4cbff310
18 changed files with 138 additions and 36 deletions

View File

@ -22,7 +22,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset solr_hostname solr_port data_dir webapp_name user verbose
unset solr_hostname solr_port data_dir webapp_name user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -38,10 +38,11 @@ usage: $prog [-h hostname] [-p port] [-d dir] [-w webappname] [-u username] [-v]
-w specify name of Solr webapp (defaults to solr)
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts h:p:d:w:u:v OPTION
while getopts h:p:d:w:u:vV OPTION
do
case $OPTION in
h)
@ -62,12 +63,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
if [[ -z ${solr_port} ]]
then
echo "Solr port number missing in $confFile or command line."

View File

@ -22,7 +22,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset solr_hostname solr_port data_dir webapp_name user verbose
unset solr_hostname solr_port data_dir webapp_name user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -38,10 +38,11 @@ usage: $prog [-h hostname] [-p port] [-d dir] [-w webapp_name] [-u username] [-v
-w specify name of Solr webapp (defaults to solr)
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts h:p:d:w:u:v OPTION
while getopts h:p:d:w:u:vV OPTION
do
case $OPTION in
h)
@ -62,12 +63,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
if [[ -z ${solr_port} ]]
then
echo "Solr port number missing in $confFile or command line."

View File

@ -21,7 +21,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset data_dir user verbose
unset data_dir user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -34,10 +34,11 @@ usage: $prog [-d dir] [-u username] [-v]
-d specify directory holding index data
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts d:u:v OPTION
while getopts d:u:vV OPTION
do
case $OPTION in
d)
@ -49,12 +50,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
# use default value for data_dir if not specified
# relative path starts at ${solr_root}
if [[ -z ${data_dir} ]]

View File

@ -21,7 +21,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset days num data_dir user verbose
unset days num data_dir user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -37,10 +37,11 @@ usage: $prog -D <days> | -N <num> [-d dir] [-u username] [-v]
-d specify directory holding index data
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts D:N:d:u:v OPTION
while getopts D:N:d:u:vV OPTION
do
case $OPTION in
D)
@ -58,12 +59,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
if [[ -z ${days} && -z ${num} ]]
then
echo "$USAGE"

View File

@ -22,7 +22,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset solr_hostname solr_port webapp_name user verbose
unset solr_hostname solr_port webapp_name user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -37,10 +37,11 @@ usage: $prog [-h hostname] [-p port] [-w webapp_name] [-u username] [-v]
-w specify name of Solr webapp (defaults to solr)
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts h:p:w:u:v OPTION
while getopts h:p:w:u:vV OPTION
do
case $OPTION in
h)
@ -58,12 +59,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
if [[ -z ${solr_port} ]]
then
echo "Solr port number missing in $confFile or command line."

View File

@ -22,7 +22,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset solr_hostname solr_port webapp_name user verbose
unset solr_hostname solr_port webapp_name user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -37,11 +37,12 @@ usage: $prog [-h hostname] [-p port] [-u username] [-v]
-w specify name of Solr webapp (defaults to solr)
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
originalargs="$@"
while getopts h:p:w:u:v OPTION
while getopts h:p:w:u:vV OPTION
do
case $OPTION in
h)
@ -59,12 +60,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
if [[ -z ${solr_port} ]]
then
echo "Solr port number missing in $confFile or command line."

View File

@ -22,7 +22,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset solr_hostname solr_port webapp_name user verbose
unset solr_hostname solr_port webapp_name user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -37,11 +37,12 @@ usage: $prog [-p hostname] [-p port] [-w webapp_name] [-u username] [-v]
-w specify name of Solr webapp (defaults to solr)
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
originalargs="$@"
while getopts h:p:w:u:v OPTION
while getopts h:p:w:u:vV OPTION
do
case $OPTION in
h)
@ -59,12 +60,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
if [[ -z ${solr_port} ]]
then
echo "Solr port number missing in $confFile or command line."

View File

@ -21,7 +21,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset user verbose
unset user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -33,10 +33,11 @@ USAGE="\
usage: $prog [-u username] [-v]
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts u:v OPTION
while getopts u:vV OPTION
do
case $OPTION in
u)
@ -45,12 +46,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
fixUser "$@"
start=`date +"%s"`

View File

@ -21,7 +21,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset user verbose
unset user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -32,10 +32,11 @@ USAGE="\
usage: $prog [-u username] [-v]
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts u:v OPTION
while getopts u:vV OPTION
do
case $OPTION in
u)
@ -44,12 +45,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
fixUser "$@"
start=`date +"%s"`

View File

@ -21,7 +21,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset data_dir solr_port rsyncd_port user verbose
unset data_dir solr_port rsyncd_port user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -35,10 +35,11 @@ usage: $prog [-d dir] [-p portnum] [-u username] [-v]
-p specify rsyncd port number
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts d:p:u:v OPTION
while getopts d:p:u:vV OPTION
do
case $OPTION in
d)
@ -53,12 +54,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
fixUser "$@"
# try to determine rsyncd port number from $confFile if not specified on

View File

@ -21,7 +21,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset user verbose
unset user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -33,10 +33,11 @@ USAGE="\
usage: $prog [-u username] [-v]
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts u:v OPTION
while getopts u:vV OPTION
do
case $OPTION in
u)
@ -45,12 +46,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
fixUser "$@"
logMessage stopped by $oldwhoami

View File

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Shell script to disable rsyncd
# util functions used by scripts
export PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH

View File

@ -21,7 +21,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset days num data_dir user verbose
unset days num data_dir user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -37,10 +37,11 @@ usage: $prog -D <days> | -N <num> [-d dir] [-u username] [-v]
-d specify directory holding index data
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts D:N:d:u:v OPTION
while getopts D:N:d:u:vV OPTION
do
case $OPTION in
D)
@ -58,12 +59,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
if [[ -z ${days} && -z ${num} ]]
then
echo "$USAGE"

View File

@ -22,7 +22,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset master_host master_status_dir data_dir user verbose
unset master_host master_status_dir data_dir user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -38,10 +38,11 @@ usage: $prog [-M master] [-S sdir] [-d dir] [-u username] [-v]
-d specify directory holding index data on local machine
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts M:S:d:u:v OPTION
while getopts M:S:d:u:vV OPTION
do
case $OPTION in
M)
@ -59,12 +60,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
if [[ -z ${master_host} ]]
then
echo "name of master server missing in $confFile or command line."

View File

@ -22,7 +22,7 @@ solr_root=$(pwd)
cd ${orig_dir}
unset master_host rsyncd_port master_data_dir master_status_dir snap_name
unset sizeonly stats data_dir user verbose compress startStatus
unset sizeonly stats data_dir user verbose debug compress startStatus
. ${solr_root}/bin/scripts-util
# set up variables
@ -43,11 +43,12 @@ usage: $prog [-M master] [-P portnum] [-D mdir] [-S sdir] [-n snapshot] [-d dir]
-u specify user to sudo to before running script
-s use the --size-only option with rsync
-v increase verbosity (-vv show file transfer stats also)
-V output debugging info
-z enable compression of data
"
# parse args
while getopts M:P:D:S:n:d:u:svz OPTION
while getopts M:P:D:S:n:d:u:svVz OPTION
do
case $OPTION in
M)
@ -77,6 +78,9 @@ do
v)
[[ -n $verbose ]] && stats="--stats" || verbose=v
;;
V)
debug="V"
;;
z)
compress="z"
;;
@ -86,6 +90,8 @@ do
esac
done
[[ -n $debug ]] && set -x
if [[ -z ${master_host} ]]
then
echo "name of master server missing in $confFile or command line."

View File

@ -21,7 +21,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset user verbose
unset user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -33,10 +33,11 @@ USAGE="\
usage: $prog [-u username] [-v]
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts u:v OPTION
while getopts u:vV OPTION
do
case $OPTION in
u)
@ -45,12 +46,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
fixUser "$@"
start=`date +"%s"`

View File

@ -21,7 +21,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset user verbose
unset user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -33,10 +33,11 @@ USAGE="\
usage: $prog [-u username] [-v]
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts u:v OPTION
while getopts u:vV OPTION
do
case $OPTION in
u)
@ -45,12 +46,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
fixUser "$@"
start=`date +"%s"`

View File

@ -21,7 +21,7 @@ cd ${0%/*}/..
solr_root=$(pwd)
cd ${orig_dir}
unset data_dir user verbose
unset data_dir user verbose debug
. ${solr_root}/bin/scripts-util
# set up variables
@ -34,10 +34,11 @@ usage: $prog [-d dir] [-u username] [-v]
-d specify directory holding index data
-u specify user to sudo to before running script
-v increase verbosity
-V output debugging info
"
# parse args
while getopts d:u:v OPTION
while getopts d:u:vV OPTION
do
case $OPTION in
d)
@ -49,12 +50,17 @@ do
v)
verbose="v"
;;
V)
debug="V"
;;
*)
echo "$USAGE"
exit 1
esac
done
[[ -n $debug ]] && set -x
fixUser "$@"
# use default value for data_dir if not specified