I've been trying to generate a deb file for a personal project of mine. The project uses sbt and sbt-native-packager to generate a deb file which I will install on my server.
I added a
templates
, config
, and postinst
script to my control archive (and confirmed that they are unpacked) but they debconf doesn't seem to detect the new templates. sudo debconf-show t-budget
comes up blank and every db_input
returns 10 "t-budget/" doesn't exist
.
Is there something I need to do to add these templates to the database besides have the files in my control archive?
Side note: I mentioned sbt-native-packager because it might be relevant that I'm not directly using the deb creation tools, but it looks like what I have should work and if this is a limitation of the tool, I'd like to know what the problem is so I could fix it.
These are the config files I'm trying to use:
$ 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...
Asked by Thomas
(111 rep)
Sep 4, 2022, 09:37 PM
Last activity: Sep 5, 2022, 06:56 PM
Last activity: Sep 5, 2022, 06:56 PM