debconf 템플릿을 찾을 수 없습니다

debconf 템플릿을 찾을 수 없습니다

저는 개인 프로젝트를 위해 deb 파일을 생성하려고 했습니다. 이 프로젝트는 sbt 및 sbt-native-packager를 사용하여 서버에 설치한 deb 파일을 생성합니다.

templates, config및 스크립트를 내 제어 아카이브에 추가했지만 postinst(그리고 압축이 풀렸는지 확인했습니다), debconf가 새 템플릿을 감지하지 못하는 것 같습니다. sudo debconf-show t-budget공백이 나타나고 매번 db_input반환됩니다 10 "t-budget/<template>" doesn't exist.

내 제어 아카이브에 파일을 배치하는 것 외에 이러한 템플릿을 데이터베이스에 추가하기 위해 수행해야 할 다른 작업이 있습니까?

참고 사항: Deb 생성 도구를 직접 사용하지 않기 때문에 sbt-native-packager를 언급했습니다. 관련성이 있을 수 있지만 이것이 도구의 제한 사항이라면 작동해야 할 것 같습니다. 문제가 무엇인지 알아야 해결할 수 있습니다.

제가 사용하려는 구성 파일은 다음과 같습니다.

$ ls -lht /var/lib/dpkg/info/t-budget.*
-rw-r--r-- 1 root root  27K Sep  4 21:54 /var/lib/dpkg/info/t-budget.md5sums
-rw-r--r-- 1 root root  20K Sep  4 21:54 /var/lib/dpkg/info/t-budget.list
-rw-r--r-- 1 root root 1.1K Sep  4 20:51 /var/lib/dpkg/info/t-budget.conffiles
-rwxr-xr-x 1 root root  815 Sep  4 20:51 /var/lib/dpkg/info/t-budget.config
-rwxr-xr-x 1 root root 2.9K Sep  4 20:51 /var/lib/dpkg/info/t-budget.postinst
-rwxr-xr-x 1 root root  100 Sep  4 20:51 /var/lib/dpkg/info/t-budget.postrm
-rwxr-xr-x 1 root root 1.9K Sep  4 20:51 /var/lib/dpkg/info/t-budget.preinst
-rwxr-xr-x 1 root root 2.9K Sep  4 20:51 /var/lib/dpkg/info/t-budget.prerm
-rwxr-xr-x 1 root root 1.6K Sep  4 20:51 /var/lib/dpkg/info/t-budget.templates

/var/lib/dpkg/info/t-budget.templates:

Template: t-budget/database/ip
Type: string
Default: localhost
Description: What is the host of your PostgreSQL server?
 T-Budget needs a postgresql server to store it's data.
 You can host one locally or have it connect over the network.
 Enter the host's domain name or IP address.
 Note: If the database is not the localhost, the install script will not be able to configure it automatically.

Template: t-budget/database/name
Type: string
Default: budget
Description: What is the name of your database?
 A single postgres server can host several isolated databases.
 It is recommended that T-Budget run on it's own database to maximize security and data integrity.

Template: t-budget/database/username
Type: string
Default: t-budget
Description: What is the PostgreSQL username?
 T-Budget should use an isolated username with limited permissions to the rest of the system.
 To create a new user, enter a username which is not yet in use.

Template: t-budget/database/password
Type: password
Description: What is the PostgreSQL password?
 If creating a new user, it will be created with this password.
 If using an existing user, this password will need to match the current password of that user.

Template: t-budget/hostnames
Type: string
Description: What is the hostname of your server?
 What is the domain name of the server users will use to access T-Budget?
 Used for security protocols.
 You can input multiple hostnames seperated by a space.
 You can also prefix your hostname with a '.' to include all subdomains in addition to the hostname.

/var/lib/dpkg/info/t-budget.config:

#!/bin/sh

set -e

# Source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0

echo "configuring..." 1>&2
db_clear
echo "CLEAR: $RET" 1>&2
db_purge
echo "PRUGE: $RET" 1>&2

db_input high     t-budget/database/ip       || true
echo "INPUT high t-budget/database/ip: $RET" 1>&2
db_input high     t-budget/database/name     || true
echo "INPUT high t-budget/database/name: $RET" 1>&2
db_input high     t-budget/database/username || true
echo "INPUT high t-budget/database/username: $RET" 1>&2
db_input critical t-budget/database/password || true
echo "INPUT critical t-budget/database/password: $RET" 1>&2
db_go
echo "GO: $RET" 1>&2

db_input critical t-budget/hostnames || true
echo "INPUT critical t-budget/hostnames: $RET" 1>&2
db_go
echo "GO: $RET" 1>&2

# TODO: validate input

/var/lib/dpkg/info/t-budget.postinst:

#!/bin/sh

# Source debconf library.
. /usr/share/debconf/confmodule

# generate config files...

답변1

그래서 공식 저장소의 작업 예제를 보고 하나씩 일치하도록 만든 후 문제를 발견했습니다.

db_purge

이 줄은 데이터베이스에서 모든 템플릿을 삭제합니다. 다른 예제를 복사해서 이것이 어떻게 작동하는지 확신할 수 없었기 때문에 이것을 추가하고 있지만 이 줄을 제거하면 문제가 해결되었습니다.

관련 정보