1 | #!/bin/bash |
---|
2 | # Shell wrapper to execute "$MAHOUT_HOME/bin/mahout" |
---|
3 | # as a hadoop user. |
---|
4 | |
---|
5 | CMDNAME=`basename "$0"` |
---|
6 | |
---|
7 | export JAVA_HOME=@java_home@ |
---|
8 | export HADOOP_HOME=@hadoop_home@ |
---|
9 | export HADOOP_CONF_DIR=$HADOOP_HOME/conf |
---|
10 | export MAHOUT_HOME=@mahout_home@ |
---|
11 | export MAHOUT_LOG_DIR=@mahout_log_dir@ |
---|
12 | |
---|
13 | SCRIPT="$MAHOUT_HOME/bin/mahout" |
---|
14 | |
---|
15 | usage() { |
---|
16 | echo "Usage: $CMDNAME [-h|--help] [-core] args" |
---|
17 | echo "Executes \"$SCRIPT\" as @hadoopuser@ user" |
---|
18 | exit 1 |
---|
19 | } |
---|
20 | |
---|
21 | if [ $# -eq 0 -o "$1" = "-h" -o "$1" = "--help" ]; then |
---|
22 | usage |
---|
23 | fi |
---|
24 | |
---|
25 | exec sudo -E -u @hadoopuser@ $SCRIPT "$@" |
---|