modules/mu/clouds/aws/userdata/linux.erb in cloud-mu-3.0.0beta vs modules/mu/clouds/aws/userdata/linux.erb in cloud-mu-3.0.0
- old
+ new
@@ -22,10 +22,16 @@
if [ ! -f "/dev/xvd$d" ];then
sed -Ein "s'^(/dev/xvd$d)'#\\1'" /etc/fstab
fi
done
+for f in /etc/rc.local /etc/rc.d/rc.local;do
+ if [ -f $f ];then
+ chmod 755 $f
+ fi
+done
+
if ping -c 5 8.8.8.8 > /dev/null; then
if [ -f /etc/debian_version ];then
if ! grep '^/bin/sh /var/lib/cloud/instance/user-data.txt$' /etc/rc.local > /dev/null;then
echo "/bin/sh /var/lib/cloud/instance/user-data.txt" >> /etc/rc.local
fi
@@ -70,15 +76,15 @@
fi
if ! grep "^/bin/sh $userdata_dir/user-data.txt$" /etc/rc.d/rc.local > /dev/null;then
cat /etc/rc.d/rc.local | grep -v '^/bin/sh /var/lib/cloud/instances/' >> /tmp/rc.local.$$
echo "/bin/sh $userdata_dir/user-data.txt" >> /tmp/rc.local.$$
mv /tmp/rc.local.$$ /etc/rc.d/rc.local
+ chmod 755 /etc/rc.d/rc.local
fi
sed -i 's/^Defaults.*requiretty$/Defaults !requiretty/' /etc/sudoers
if [ "$version" == "7" ];then
- chmod 755 /etc/rc.d/rc.local
systemctl reset-failed sshd.service
fi
if [ ! -f /usr/bin/curl ] ;then /usr/bin/yum -y install curl;fi
# Ugh, rando EPEL mirror
if [ ! -f /etc/yum.repos.d/epel.repo ];then