summaryrefslogtreecommitdiff
path: root/hadoop/hadoop.install
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-09-20 13:54:23 +0200
committerErich Eckner <git@eckner.net>2017-09-20 13:54:23 +0200
commit2d25332ee18e690d3ee4b865e53d748f460f8ab1 (patch)
treedcd476ae4d54912ce24e6d892fc7b7dbf1d733ba /hadoop/hadoop.install
parent88c2c6c63748ea1b30a58b938c3924b887b34ae9 (diff)
downloadarchlinuxewe-2d25332ee18e690d3ee4b865e53d748f460f8ab1.tar.xz
hadoop neu
Diffstat (limited to 'hadoop/hadoop.install')
-rw-r--r--hadoop/hadoop.install32
1 files changed, 32 insertions, 0 deletions
diff --git a/hadoop/hadoop.install b/hadoop/hadoop.install
new file mode 100644
index 000000000..a7b1b075e
--- /dev/null
+++ b/hadoop/hadoop.install
@@ -0,0 +1,32 @@
+post_install() {
+ getent group 'hadoop' >/dev/null 2>&1 || groupadd -r 'hadoop' >/dev/null
+ getent passwd 'hadoop' /dev/null 2>&1 || 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 '/usr/bin/bash' -c "ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa" - 'hadoop'
+ su -s '/usr/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'
+}
+
+post_upgrade() {
+ :
+}
+
+post_remove() {
+ getent passwd 'hadoop' >/dev/null 2>&1 && userdel 'hadoop' >/dev/null
+ getent group 'hadoop' >/dev/null 2>&1 && groupdel 'hadoop' >/dev/null
+}