summarylogtreecommitdiffstats
path: root/hadoop.install
diff options
context:
space:
mode:
authorDavid Roheim2015-06-12 19:09:56 +0300
committerDavid Roheim2015-06-12 19:09:56 +0300
commit23e83e60db7713207c98bc8b352cd665ba9c8546 (patch)
tree039da8018d8400dfd6f68b86ec8c3a0ff36db38f /hadoop.install
downloadaur-23e83e60db7713207c98bc8b352cd665ba9c8546.tar.gz
Inistial commit
Diffstat (limited to 'hadoop.install')
-rw-r--r--hadoop.install34
1 files changed, 34 insertions, 0 deletions
diff --git a/hadoop.install b/hadoop.install
new file mode 100644
index 000000000000..48536c51c471
--- /dev/null
+++ b/hadoop.install
@@ -0,0 +1,34 @@
+post_install() {
+ getent group hadoop &>/dev/null || groupadd -r hadoop >/dev/null
+ getent passwd hadoop &>/dev/null || useradd -r -g hadoop -d /etc/hadoop hadoop >/dev/null
+
+ if [ ! -d /etc/hadoop/.ssh ] ; then
+ mkdir -p /etc/hadoop/.ssh
+ fi
+
+ chown -R hadoop:hadoop /etc/hadoop
+
+ if [ ! -e /etc/hadoop/.ssh/id_rsa ] ; then
+ su -s /bin/bash -c "ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa" - hadoop
+ su -s /bin/bash -c "cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys" - hadoop
+ fi
+
+ echo "An SSH key-pair has been created. Depending on your SSHD configuration you may"
+ echo "need to connect to localhost as user 'hadoop' to make sure Hadoop can connect."
+ echo ""
+ echo "$ ssh localhost"
+
+ echo ""
+ echo "===> Read https://wiki.archlinux.org/index.php/Hadoop for more information"
+ true
+}
+
+post_upgrade() {
+ true
+}
+
+post_remove() {
+ getent passwd hadoop &>/dev/null && userdel hadoop >/dev/null
+ getent group hadoop &>/dev/null && groupdel hadoop >/dev/null
+ true
+}