From b8c1fad925a1bfe98b1f817a6fec6e113b90de68 Mon Sep 17 00:00:00 2001
From: Marco Mariani <marco.mariani@nexedi.com>
Date: Fri, 21 Feb 2014 16:16:11 +0100
Subject: [PATCH] hadoop: start-daemons.sh

---
 stack/hadoop/instance-stack.cfg.in        |  2 +-
 stack/hadoop/template/start-daemons.sh.in | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 stack/hadoop/template/start-daemons.sh.in

diff --git a/stack/hadoop/instance-stack.cfg.in b/stack/hadoop/instance-stack.cfg.in
index 069af41f..5f0844b2 100644
--- a/stack/hadoop/instance-stack.cfg.in
+++ b/stack/hadoop/instance-stack.cfg.in
@@ -44,7 +44,7 @@ promises = $${directories:etc}/promise
 
 [start-daemons]
 recipe = slapos.recipe.template
-url = ${:_profile_base_location_}/template/bin/start-daemons.sh.in
+url = ${:_profile_base_location_}/template/start-daemons.sh.in
 output = $${directories:bin}/start-daemons.sh
 # md5sum =
 mode = 0755
diff --git a/stack/hadoop/template/start-daemons.sh.in b/stack/hadoop/template/start-daemons.sh.in
new file mode 100644
index 00000000..2e0a6f4f
--- /dev/null
+++ b/stack/hadoop/template/start-daemons.sh.in
@@ -0,0 +1,14 @@
+#!/bin/bash
+## Start HDFS daemons
+# Format the namenode directory (DO THIS ONLY ONCE, THE FIRST TIME)
+#$HADOOP_PREFIX/bin/hdfs namenode -format
+# Start the namenode daemon
+$HADOOP_PREFIX/sbin/hadoop-daemon.sh start namenode
+# Start the datanode daemon
+$HADOOP_PREFIX/sbin/hadoop-daemon.sh start datanode
+ 
+## Start YARN daemons
+# Start the resourcemanager daemon
+$HADOOP_PREFIX/sbin/yarn-daemon.sh start resourcemanager
+# Start the nodemanager daemon
+$HADOOP_PREFIX/sbin/yarn-daemon.sh start nodemanager
-- 
2.30.9