vagrant: Use id -g for finding a user's group.

On OSX, the user id and group id don't match.  So while the previous
code was always wrong, it produced incorrect output there.  We can fix
this by replacing `whoami` with `id -g` for finding the current user's
group ID.
This commit is contained in:
Puneeth Chaganti 2018-11-01 10:08:29 +05:30 committed by Tim Abbott
parent 1490653e42
commit 19990b06e9
3 changed files with 3 additions and 3 deletions

2
Vagrantfile vendored
View File

@ -202,7 +202,7 @@ if [ ! -w /srv/zulip ]; then
# sudo is required since our uid is not 1000 # sudo is required since our uid is not 1000
echo ' vagrant halt -f' echo ' vagrant halt -f'
echo ' rm -rf /PATH/TO/ZULIP/CLONE/.vagrant' echo ' rm -rf /PATH/TO/ZULIP/CLONE/.vagrant'
echo ' sudo chown -R 1000:$(whoami) /PATH/TO/ZULIP/CLONE' echo ' sudo chown -R 1000:$(id -g) /PATH/TO/ZULIP/CLONE'
echo "Replace /PATH/TO/ZULIP/CLONE with the path to where zulip code is cloned." echo "Replace /PATH/TO/ZULIP/CLONE with the path to where zulip code is cloned."
echo "You can resume setting up your vagrant environment by running:" echo "You can resume setting up your vagrant environment by running:"
echo " vagrant up" echo " vagrant up"

View File

@ -889,7 +889,7 @@ It is okay to proceed and start the Zulip server.
##### Permissions errors ##### Permissions errors
When building the development environment using Vagrant and the LXC provider, When building the development environment using Vagrant and the LXC provider,
if you encounter permissions errors, you may need to `chown -R 1000:$(whoami) if you encounter permissions errors, you may need to `chown -R 1000:$(id -g)
/path/to/zulip` on the host before running `vagrant up` in order to ensure that /path/to/zulip` on the host before running `vagrant up` in order to ensure that
the synced directory has the correct owner during provision. This issue will the synced directory has the correct owner during provision. This issue will
arise if you run `id username` on the host where `username` is the user running arise if you run `id username` on the host where `username` is the user running

View File

@ -126,7 +126,7 @@ something valuable to helping keep Zulip bug-free.
- When building the development environment using Vagrant and the LXC - When building the development environment using Vagrant and the LXC
provider, if you encounter permissions errors, you may need to provider, if you encounter permissions errors, you may need to
`chown -R 1000:$(whoami) /path/to/zulip` on the host before running `chown -R 1000:$(id -g) /path/to/zulip` on the host before running
`vagrant up` in order to ensure that the synced directory has the `vagrant up` in order to ensure that the synced directory has the
correct owner during provision. This issue will arise if you run `id correct owner during provision. This issue will arise if you run `id
username` on the host where `username` is the user running Vagrant username` on the host where `username` is the user running Vagrant