-
Notifications
You must be signed in to change notification settings - Fork 13
/
cn-setup.sh
38 lines (29 loc) · 1022 Bytes
/
cn-setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# fail on any error
set -e
HEADNODE=10.0.2.4
sed -i 's/^ResourceDisk.MountPoint=\/mnt\/resource$/ResourceDisk.MountPoint=\/mnt\/local_resource/g' /etc/waagent.conf
umount /mnt/resource
mkdir -p /mnt/resource/scratch
cat << EOF >> /etc/security/limits.conf
* hard memlock unlimited
* soft memlock unlimited
* hard nofile 65535
* soft nofile 65535
EOF
cat << EOF >> /etc/fstab
$HEADNODE:/home /home nfs defaults 0 0
$HEADNODE:/mnt/resource/scratch /mnt/resource/scratch nfs defaults 0 0
EOF
#yum --enablerepo=extras install -y -q epel-release
#yum install -y -q nfs-utils htop pdsh psmisc
until yum install -y -q nfs-utils
do
sleep 10
done
setsebool -P use_nfs_home_dirs 1
mount -a
# Don't require password for HPC user sudo
echo "hpcuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# Disable tty requirement for sudo
sed -i 's/^Defaults[ ]*requiretty/# Defaults requiretty/g' /etc/sudoers