GNU/Linux:安装卷的程序的行为规范(如果有)是什么?

GNU/Linux:安装卷的程序的行为规范(如果有)是什么?

更新:下面的答案中提供的规范否定了实际的问题,即它适用于更广泛的规范范围,从而消除了对这个问题的需要(参见答案)。

我正在努力寻找关于此的有凝聚力的文档。基本上,我想知道,在可能的情况下参考,安装卷的可执行文件的标准是什么。澄清一下:我正在寻找一个规范。以下是一些示例:

*. The executable *may* mount a volume at a subdirectory of the path provided by the caller (say it's not an empty directory), eg $ARGX/$NEWPLACE
*. The executable *cannot* create directories ever.
*. The executable *cannot* create directories unless specified by the caller.
*. The executable *may* create directories specified by the caller if they do not exist.
*. The executable *must* mount a volume at /mnt/$OTHERPATH if the mount point passed by the caller is unavailable.
*. The executable *cannot* mount a volume at $BADPATH, $WORSEPATH, and the like, even if specified by the caller.
*. The caller *expects* the volume mounted at $ARGX
*. The caller *expects* to be alerted if the mount point is not empty
*. The caller *expects* the executable to abort on all errors.

原因是,只要看看各种发行版,它们不仅多年来发生了变化,而且每个人对事情的走向都有自己的看法(这里有点切线:/mnt/$USER/$VOLUME 不是一个更好的全局版本吗?层次结构的解决方案,因为 /mnt 最初用于安装东西,并且为每个用户拥有一个单独的目录将像 /home/$USER/ 那样发挥作用?)。回到主题,我希望尽可能保持与发行版无关(我意识到这就像要求让所有人一直快乐),因此任何“规范”都会受到赞赏。谢谢。

答案1

我找不到专门参考安装的规范,但是第 19 章其他建议 - Linux 标准基本核心规范,通用部分似乎适用。

19.1.1。目录写入权限

应用程序不应依赖于除 /tmp、/var/tmp 和调用用户的主目录之外的任何目录中的目录写入权限。

相关内容