Ticket #29560: mahout-bin

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