I am having some trouble using debconf for my package. I ask for the mysql pw in the package.config file:
. /usr/share/debconf/confmodule
db_input high mypkg/mysql_root_pw
db_go
Then, in postinst, I ask debconf for the password and write it to a config file:
. /usr/share/debconf/confmodule
db_get mypkg/mysql_root_pw
# write pw to config file
This works when I do dpkg-reconfigure --force mypkg
. However, when using apt-get -f install
(which I have to do because it says my pkg is broken) it always fails:
Setting up mypkg (1.5.4-3) ...
debconf (developer): frontend started
debconf (developer): frontend running, package name is mypkg
debconf (developer): starting /var/lib/dpkg/info/mypkg.config configure
debconf (developer): <-- INPUT low mypkg/mysql_root_pw
debconf (developer): --> 30 question skipped
dpkg: error processing mypkg (--configure):
subprocess installed post-installation script returned error exit status 30
Errors were encountered while processing:
mypkg
I edited the scripts in /var/lib/dpkg/info/mypkg.postinst
and the error occurs on the line where I source the debconf library:
. /usr/share/debconf/confmodule
This is probably because debconf already has the value from the original install and does not show the question again. But how can I skip asking it if I already have it and why does it fail on that line instead of when when I do db_get
?
I have search google and can't seem to find much useful info on this.