使用Sublime编辑Yocto文件,导致bitbake server启动失败

Mar*_*ark 2 sublimetext3 yocto

如果我在 Ubuntu 16.04 下使用Sublime打开我的 Yocto 项目文件夹并尝试构建:

bitbake <image>
Run Code Online (Sandbox Code Playgroud)

我收到这些错误:

ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/build-openstlinuxeglfs-stm32mp1-sw25v00/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 4602 at 2020-02-01 02:59:00.519051 ---
Traceback (most recent call last):
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/bb/daemonize.py", line 83, in createDaemon
    function()
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/bb/server/process.py", line 469, in _startServer
    self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/bb/cooker.py", line 210, in __init__
    self.initConfigurationData()
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/bb/cooker.py", line 396, in initConfigurationData
    self.add_filewatch(mc.getVar("__base_depends", False), self.configwatcher)
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/bb/cooker.py", line 306, in add_filewatch
    watcher.add_watch(f, self.watchmask, quiet=False)
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/pyinotify.py", line 1924, in add_watch
    raise WatchManagerError(err, ret_)
pyinotify.WatchManagerError: add_watch: cannot watch /local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/build-openstlinuxeglfs-stm32mp1-sw25v00/conf WD=-1, Errno=No space left on device (ENOSPC)
ERROR: No space left on device or exceeds fs.inotify.max_user_watches?
ERROR: To check max_user_watches: sysctl -n fs.inotify.max_user_watches.
ERROR: To modify max_user_watches: sysctl -n -w fs.inotify.max_user_watches=<value>.
ERROR: Root privilege is required to modify max_user_watches.
Run Code Online (Sandbox Code Playgroud)

关闭编辑器并再次发出该命令可以正常工作。其他编辑器(如gedit)没有这种行为。

我知道我可以没有Sublime,但我想了解 che 错误的原因。

Oda*_*urd 5

你的inotify手表快用完了。诸如 Sublime 之类的软件和您在此处运行的程序(以及其他程序)使用inotify监视来检测文件系统的更改,例如能够跟踪文件何时更改或目录内容何时更改。

一次可以使用的手表数量有一个(用户可设置的)上限,您在此处看到的相当神秘的错误消息是达到限制并且程序无法获取手表的症状。

对于inotify您正在使用的软件(和文件量),您的系统上的最大监视默认值可能设置得不够高,但您可以根据需要进行更改。

错误诊断信息底部的输出显示了如何查看/调整上限。以下问题也显示了您如何做到这一点。

https://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached