Created
September 19, 2012 19:35
-
-
Save cgorshing/3751739 to your computer and use it in GitHub Desktop.
Beginnings of a hadoop upstart script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://upstart.ubuntu.com/cookbook/ | |
#http://www.bryanmarty.com/2012/02/setting-nofile-limit-upstart/ | |
description "Hadoop @HADOOP_DAEMON@" | |
author "Chad Gorshing <gorshing@gmail.com>" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
env LOG_FILE="/var/log/hadoop/@HADOOP_DAEMON@.log" | |
env HADOOP_USER="hadoop" | |
env HADOOP_HOME="/opt/sbi/hadoop" | |
env EXE_FILE="/opt/sbi/hadoop/bin/start-dfs.sh" | |
#limit nofile 32768 32768 | |
pre-start script | |
# Check to ensure hadoop still installed | |
test -f $EXE_FILE || { stop ; exit 0; } | |
end script | |
script | |
[ -r /etc/default/hive ] && . /etc/default/hive | |
service_name="@HADOOP_DAEMON@" | |
[ "$service_name" = "server" ] && service_name="hadoopserver" | |
#HADOOP_HOME="`eval echo ~$HADOOP_USER`" | |
exec /sbin/start-stop-daemon --start --user $HADOOP_USER --name hadoop-@HADOOP_DAEMON@ \ | |
--chuid $HADOOP_USER --chdir $HADOOP_HOME --exec $EXE_FILE -- \ | |
--service $service_name $PORT > $LOG_FILE 2>&1 < /dev/null | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment