Review Board 1.7.22


Sqoop2: sqoop.sh execution error

Review Request #10689 - Created April 21, 2013 and updated

Vasanth kumar RJ
SQOOP-1003
Reviewers
Sqoop
sqoop-sqoop2
Problem while starting and stopping sqoop server.
Patch supports softlink for both server and client command. 
Done

Diff revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

1 2
1 2

  1. dist/src/main/bin/sqoop.sh: Loading...
dist/src/main/bin/sqoop.sh
Revision a218441 New Change
[20] 27 lines
[+20]
28
  print_usage
28
  print_usage
29
  exit
29
  exit
30
fi
30
fi
31

    
   
31

   
32
OLD_DIR=`pwd`
32
OLD_DIR=`pwd`
33
CUR_DIR=`cd $(dirname $(which $0))/..; pwd`
33

   
Moved from 62

    
   
34
# resolve links - $0 may be a softlink
Moved from 63

    
   
35
PRG="${0}"

    
   
36

   
Moved from 65

    
   
37
while [ -h "${PRG}" ]; do
Moved from 66

    
   
38
  ls=`ls -ld "${PRG}"`
Moved from 67

    
   
39
  link=`expr "$ls" : '.*-> \(.*\)$'`
Moved from 68

    
   
40
  if expr "$link" : '/.*' > /dev/null; then
Moved from 69

    
   
41
    PRG="$link"
Moved from 70

    
   
42
  else
Moved from 71

    
   
43
    PRG=`dirname "${PRG}"`/"$link"
Moved from 72

    
   
44
  fi
Moved from 73

    
   
45
done

    
   
46

   
Moved from 75

    
   
47
BASEDIR=`dirname ${PRG}`
Moved from 76

    
   
48
BASEDIR=`cd ${BASEDIR}/..;pwd`

    
   
49

   

    
   
50
echo "BASE DIR :${BASEDIR}"

    
   
51

   

    
   
52
CUR_DIR=${BASEDIR}
34
cd ${CUR_DIR}
53
cd ${CUR_DIR}
35
echo "Sqoop home directory: ${CUR_DIR}..."
54
echo "Sqoop home directory: ${BASEDIR}"
36

    
   
55

   
37
CATALINA_BIN=${CATALINA_BIN:-server/bin}
56
CATALINA_BIN=${CATALINA_BIN:-server/bin}
38
CLIENT_LIB=${CLIENT_LIB:-client/lib}
57
CLIENT_LIB=${CLIENT_LIB:-client/lib}
39

    
   
58

   
40
setup_catalina_opts() {
59
setup_catalina_opts() {
[+20] [20] 16 lines
[+20]
57
      echo "Usage: sqoop.sh server <start/stop>"
76
      echo "Usage: sqoop.sh server <start/stop>"
58
      exit
77
      exit
59
    fi
78
    fi
60
    actionCmd=$2
79
    actionCmd=$2
61

    
   
80

   
62
    # resolve links - $0 may be a softlink
Moved to 34

   
63
    PRG="${0}"
Moved to 35

   
64

    
   

   
65
    while [ -h "${PRG}" ]; do
Moved to 37

   
66
      ls=`ls -ld "${PRG}"`
Moved to 38

   
67
      link=`expr "$ls" : '.*-> \(.*\)$'`
Moved to 39

   
68
      if expr "$link" : '/.*' > /dev/null; then
Moved to 40

   
69
        PRG="$link"
Moved to 41

   
70
      else
Moved to 42

   
71
        PRG=`dirname "${PRG}"`/"$link"
Moved to 43

   
72
      fi
Moved to 44

   
73
    done
Moved to 45

   
74

    
   

   
75
    BASEDIR=`dirname ${PRG}`
Moved to 47

   
76
    BASEDIR=`cd ${BASEDIR}/..;pwd`
Moved to 48

   
77

    
   

   
78
    source ${BASEDIR}/bin/sqoop-sys.sh
81
    source ${BASEDIR}/bin/sqoop-sys.sh
79
    setup_catalina_opts
82
    setup_catalina_opts
80

    
   
83

   
81
    # There seems to be a bug in catalina.sh whereby catalina.sh doesn't respect
84
    # There seems to be a bug in catalina.sh whereby catalina.sh doesn't respect
82
    # CATALINA_OPTS when stopping the tomcat server. Consequently, we have to hack around
85
    # CATALINA_OPTS when stopping the tomcat server. Consequently, we have to hack around
[+20] [20] 31 lines
  1. dist/src/main/bin/sqoop.sh: Loading...