首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Debhelper管理配置文件

使用Debhelper管理配置文件
EN

Server Fault用户
提问于 2022-01-25 13:23:27
回答 1查看 202关注 0票数 1

我已经使用Debhelper打包了Debian应用程序。应用程序的配置文件位于/opt/{package}/releases/default/下,而不是/etc/{package}/下,不能很容易地移动。直到最近,标记此配置文件为conffile所需的所有内容都是将其包含在打包文件debian/{package}.conffiles中。这产生了预期的效果,apt/dpkg将在升级时检测到配置文件的本地更改,并以智能的方式处理它,而不是用打包的版本破坏本地更改。

在将包工具升级到较新的版本之后,我不再享受这一好处。手册页dh_installdeb(1)内容如下:

代码语言:javascript
复制
{package}.conffiles:
  Historically, this file was needed to manually mark files files as 
  conffiles.  However, it has become de facto obsolete since debhelper 
  automatically computed which files should be marked as conffiles.

此外,请参阅Debian新维护人员指南:

代码语言:javascript
复制
5.3. conffiles
  dh_installdeb(1) automatically flags any files under the /etc directory 
  as conffiles, so if your program only has conffiles there you do not 
  need to specify them in this file. For most package types, the only place 
  conffiles should ever be is under /etc, and so this file doesn't need to exist.

我的问题是如何通过将配置文件保存在/opt/下来实现旧的行为?

EN

回答 1

Server Fault用户

发布于 2022-11-24 07:27:20

Debian政策说,配置文件必须在/etc中,如果修改包直接从/etc读取是不可行的,则使用符号链接:

10.7.2.您的包创建或使用的任何配置文件必须驻留在/etc中。...如果您的包在/etc之外创建或使用配置文件,并且不可能修改包直接使用/etc,将文件放在/etc中并从包所需的位置创建指向这些文件的符号链接。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1091101

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档