带有 debconf 预选的软件包

发布于 2024-11-17 05:27:31 字数 239 浏览 3 评论 0原文

我想创建一个依赖于 mysql-server 的包,并将密码设置为自己随机生成的字符串,以防服务器尚未安装。 我不想让用户输入密码,并且我很高兴从 debconf 文件中获取当前密码。

但是我如何保证我的包在安装 mysql-server 包之前预设了 mysql-server-5.1/root_password 呢? mysql-server 被列为我的包的依赖项。

I'd like to create a package which will depend on mysql-server and set the password to its own randomly generated string in case the server is not installed yet.
I don't want to have the user put in the password and I'm happy to get the current password from the debconf's file.

But how can I guarantee that my package presets mysql-server-5.1/root_password before the mysql-server package is installed? mysql-server is listed as a dependency of my package.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青春有你 2024-11-24 05:27:31

你不能保证这一点。事实上,它保证完全按照相反的方向工作。来自 http://www.debian.org/doc/debian-policy/ ch-relationships.html

五个依赖字段的含义如下:

视情况而定

这声明了绝对依赖。除非正确配置了 Depends 字段中列出的所有包(除非存在如上所述的循环依赖项),否则不会配置包。

最好的办法是在正确安装 MySQL 后让您的软件包正常工作——如果您确实需要该功能,可以通过重置密码来实现。

You cannot guarantee that. In fact, it is guaranteed to work exactly the other direction. From http://www.debian.org/doc/debian-policy/ch-relationships.html:

The meaning of the five dependency fields is as follows:

Depends

This declares an absolute dependency. A package will not be configured unless all of the packages listed in its Depends field have been correctly configured (unless there is a circular dependency as described above).

Your best bet is to make your package work after MySQL is properly installed--possibly by resetting the password, if you really need that functionality.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文