我的Vagrant box是从基本linux(科学linux)构建的,在配置(使用shell脚本)过程中,安装了Apache.
我最近将Vagrant文件(v2)更改为:
config.vm.synced_folder "public", "/var/www/sites.d/example.com",
:owner => "apache", :group => "apache"
如果盒子已经配置好,并且刚刚重新启动,那么这个功能就可以正常工作.
现在,vagrant destroy && vagrant up
次之后,我得到了错误:
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 does not exist
这一点很清楚——在最初的运行中,apache尚未安装.
一个难看的解决方法当然是用synced_folder
条注释掉的内容进行基本的资源调配,然后重新启动.
有什么干净的方法可以解决这个问题吗?尤其是在这样一种情况下,vagrant up
总是不间断地运行,即使盒子是新的.