Ticket #29542: hadoop-bin

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