为什么 vagrant 不清理 nfs 导出文件? [英] Why doesn't vagrant clean nfs exports file?

查看:23
本文介绍了为什么 vagrant 不清理 nfs 导出文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以当我停止机器时,我震惊地意识到 vagrant 没有通过/etc/exports 清除它对 nfs 的导出.这是预期的还是正常的行为.无论如何我可以让 vagrant 清理它,以便当我停止它并启动另一个使用 nfs 的 vagrant 设置时,与 nfs 共享没有任何冲突.我现在必须手动执行此操作.

So I was shocked to realize that vagrant doesn't cleanup its exports to nfs via /etc/exports when I halt the machine. Is this expected or normal behavior. Is there anyway I can make vagrant clean it up so that when i halt it and launch another vagrant setup that uses nfs there aren't any conflicts with nfs shares. I have to do this manually right now.

推荐答案

出现冲突的原因似乎是 OSX 或 NFS 从现有共享的父目录挂载共享时出现问题.所以我指责流浪者没有删除共享是不正确的,尽管我仍然不完全确定为什么当你停止虚拟机时他们需要留在那里.

It appears the reason there were conflicts is cause OSX or NFS have issues mounting shares from a parent directory of an existing share. So me blaming vagrant for not removing shares was incorrect although i'm still not entirely sure why they need to stay there when you halt the vm anyway.

我之前的设置.

# VAGRANT-BEGIN: 501 ee3f798c-5786-4ab8-8e98-9e20cede811c
"/Users/username/Code/app" 192.168.10.10 -alldirs -mapall=501:20
# VAGRANT-END: 501 ee3f798c-5786-4ab8-8e98-9e20cede811c
# VAGRANT-BEGIN: 501 5b85e6ec-04ac-4b0d-b7cd-a36b57a39bdd
"/Users/username/Code" 192.168.22.10 -alldirs -mapall=501:20
# VAGRANT-END: 501 5b85e6ec-04ac-4b0d-b7cd-a36b57a39bdd

我不得不把它改成这样,这样 nfs 就不会向 vagrant 抛出错误.

I had to change it to this so that nfs wouldn't throw an error to vagrant.

# VAGRANT-BEGIN: 501 ee3f798c-5786-4ab8-8e98-9e20cede811c
"/Users/username/Code/app" 192.168.10.10 -alldirs -mapall=501:20
# VAGRANT-END: 501 ee3f798c-5786-4ab8-8e98-9e20cede811c
# VAGRANT-BEGIN: 501 5b85e6ec-04ac-4b0d-b7cd-a36b57a39bdd
"/Users/username/Code/app2" 192.168.22.10 -alldirs -mapall=501:20
# VAGRANT-END: 501 5b85e6ec-04ac-4b0d-b7cd-a36b57a39bdd

这篇关于为什么 vagrant 不清理 nfs 导出文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆