在debian软件包安装过程中获取用户输入

当前,我正在开发一个自定义的debian软件包,以将一些文件安装到目标。在安装过程中,我想向用户询问数据库凭据以构建配置文件。我当前的方法是使用debconf。但是基于以下模板,在通过apt-get install进行软件包安装期间不会出现任何问题。其余安装将按预期进行。

我的debian软件包文件夹的当前树

+---DEBIAN
|       config
|       control
|       postinst
|       rules
|       templates
|       
+---etc
|   +---lighttpd
|   |   +---conf-available
|   |   |       99-webinterface.conf
|   |   |       
|   |   \---conf-enabled
|   |           99-webinterface.conf
|   |           
|   \---systemd
|       \---system
|               sir_dbservice.service
|               
\---var
    \---www
        \---html
            |   somefiles

config

#!/bin/sh
set -e
. /usr/share/debconf/confmodule

# Ask questions.
db_input critical webdb/dbuser || true
db_input critical webdb/dbpassword || true
db_go

模板

Template: webdb/dbuser
Type: string
Default: postgres
Description: Which postgres db user?

Template: webdb/dbpassword
Type: password
Description: Please type in the password for the chosen user.

感谢您的帮助:)

bg 塞巴斯蒂安

iCMS 回答:在debian软件包安装过程中获取用户输入

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2124897.html

大家都在问