Skip to content
This repository was archived by the owner on Oct 31, 2019. It is now read-only.

Commit db7ad33

Browse files
committed
Guarantee ubuntu home dir ownership
1 parent a38d1f3 commit db7ad33

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

instances/etcd/cloud_init/bootstrap.template.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@ done
6262

6363
# put the flannel config in etcd
6464
curl -sf -L http://$FQDN_HOSTNAME:2379/v2/keys/flannel/network/config -X PUT --data-urlencode value@/tmp/flannel-network.json
65+
66+
# make sure ubuntu owns home dir
67+
chown ubuntu:ubuntu /home/ubuntu
68+

instances/k8smaster/scripts/setup.template.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ EXTERNAL_IP=$(curl -s -m 10 http://whatismyip.akamai.com/)
44
NAMESPACE=$(echo -n "${domain_name}" | sed "s/\.oraclevcn\.com//g")
55
FQDN_HOSTNAME=$(getent hosts $(ip route get 1 | awk '{print $NF;exit}') | awk '{print $2}')
66

7+
# make sure ubuntu owns home dir
8+
chown ubuntu:ubuntu /home/ubuntu
9+
710
## create policy file that blocks autostart of services on install
811
printf '#!/bin/sh\necho "All runlevel operations denied by policy" >&2\nexit 101\n' >/tmp/policy-rc.d && chmod +x /tmp/policy-rc.d
912
ETCD_LB=${etcd_lb}

instances/k8sworker/scripts/setup.template.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ EXTERNAL_IP=$(curl -s -m 10 http://whatismyip.akamai.com/)
44
NAMESPACE=$(echo -n "${domain_name}" | sed "s/\.oraclevcn\.com//g")
55
FQDN_HOSTNAME=$(getent hosts $(ip route get 1 | awk '{print $NF;exit}') | awk '{print $2}')
66

7+
# make sure ubuntu owns home dir
8+
chown ubuntu:ubuntu /home/ubuntu
9+
710
# pull instance metadata
811
curl -sL --retry 3 http://169.254.169.254/opc/v1/instance/ | tee /tmp/instance_meta.json
912

0 commit comments

Comments
 (0)