【问题标题】:How to change dconf directory?如何更改 dconf 目录?
【发布时间】:2021-05-28 03:51:52
【问题描述】:

我创建了一个用于运行 java 程序的奇异容器。一切似乎都正常,预计我会收到以下警告:

(java:54036): dconf-CRITICAL **: 23:37:10.142: unable to create directory '/run/user/175387/dconf': Read-only file system.  dconf will not work properly.

通过搜索,我了解到dconf 只是一个将配置设置存储在某个二进制文件中的系统。奇点容器是一个只读文件系统,所以出现这样的问题对我来说并不奇怪。

当我调用奇异容器时,我可以从主机操作系统绑定目录。这些绑定目录可能是可写的。因此,我最好的猜测是,我需要做的就是将 dconf 文件更改为位于这些绑定的可写目录之一内。所以,我的问题只是如何做到这一点。

顶层dconf帮助输出为:

Commands:
  help              Show this information
  read              Read the value of a key
  list              List the contents of a dir
  write             Change the value of a key
  reset             Reset the value of a key or dir
  compile           Compile a binary database from keyfiles
  update            Update the system databases
  watch             Watch a path for changes
  dump              Dump an entire subpath to stdout
  load              Populate a subpath from stdin

这些似乎都与更改 dconf 文件的位置无关。

一种解决方法可能是构建一个可写的奇点容器。但我更喜欢不同的解决方案来保持奇点容器只读。

【问题讨论】:

    标签: java linux singularity-container


    【解决方案1】:

    最简单的解决方案,也是我用于从奇异容器运行的 GUI 程序的解决方案,是使用 -B /run/user/$UID 将用户的运行直接挂载到容器。

    如果您担心用户不希望的 dconf 设置持续存在,我建议使用 --writable-tmpfs 标志,该标志创建一个 tmpfs 覆盖,可用于修改容器映像,直到该过程完成。

    【讨论】:

      猜你喜欢
      • 2012-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-02
      • 2020-06-26
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      相关资源
      最近更新 更多