Avoid sudo in env.sh
diff --git a/Vagrantfile b/Vagrantfile
index 2508217..a9b414a 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -16,7 +16,7 @@
d.vm.network "private_network", ip: "10.100.198.220"
d.vm.provision :shell, path: "ansible/scripts/bootstrap_ansible.sh"
d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /voltha/ansible/voltha.yml -c local"
- d.vm.provision :shell, inline: "cd /voltha && source env.sh && make install-protoc"
+ d.vm.provision :shell, inline: "cd /voltha && source env.sh && make install-protoc && chmod 777 /tmp/fluentd"
d.vm.provider "virtualbox" do |v|
v.memory = 4096
end
diff --git a/env.sh b/env.sh
index a58ac9d..8f3a07c 100644
--- a/env.sh
+++ b/env.sh
@@ -16,6 +16,16 @@
export DOCKER_HOST_IP=$(python voltha/nethelpers.py)
# to avoid permission issues, create a dir for fluentd logs
+# of if it exists make sure we can write to it
mkdir -p /tmp/fluentd
-sudo chown $USER /tmp/fluentd
+if ! touch /tmp/fluentd/.check_write_permission; then
+ echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+ echo "You don't have write privileges for the log directory"
+ echo "/tmp/fluentd. This will cause issues when running the"
+ echo "fluentd container with docker-compose. We suggest you"
+ echo "fox your write permission before proceeding."
+ echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+else
+ rm -f /tmp/fluentd/.check_write_permission
+fi