linux - Vagrant chicken-and-egg: Shared folder with uid = apache user -
my vagrant box build base linux (scientific linux), during provisioning (using shell scripts), apache installed.
i changed vagrant file (v2) to:
config.vm.synced_folder "public", "/var/www/sites.d/example.com", :owner => "apache", :group => "apache"
which works if box provisioned , rebooted.
now, after vagrant destroy && vagrant up
error:
mount -t vboxsf -o uid=`id -u apache`,gid=`id -g apache` /var/www/sites.d/example.com /var/www/sites.d/example.com id: apache: user not exist
which clear - during initial run, apache not yet installed.
an ugly workaround of course basic provisioning synced_folder
commented out, comment in , reboot.
is there clean trick solve that? in way vagrant up
runs without interruptions, if box new.
ryan sechrest has dealt extensively problem.
one of presented solutions is:
set permissions of directories 777 , files 666
config.vm.synced_folder "/users/ryansechrest/projects/sites", "/var/www/domains", mount_options: ["dmode=777", "fmode=666"]
Comments
Post a Comment