Debian: What is Best Practice when a question from a dpkg install must be asked on every install/upgrade?
2
votes
2
answers
625
views
I have a .deb installer for a Django system and there are questions I need to ask the person installing the software. I can see a few ways to do this, and I want to know what constitutes best practice for a Debian package.
Now normally, debconf would be the obvious solution. However in this case I want to ask the question every time, rather than have Debian memorize them and apply them to every subsequent upgrade. The reason for that has to do with the nature of the questions. Specifically, the questions are "Do you want to apply database migrations now?" and "Do you want to set up a demo database?"
Now, these could both be done manually after the install, but experience so far shows that this step is easy to forget, so I'd like to prompt for it. The Migration step I'd do automatically, except we occasionally need to migrate databases from other machines, and that's easier to do before migrations are applied. The "demo database" question would only usually be used on a first install and therefore depends on the migration case. BUT, we don't want Debian to remember that choice and apply it every time since it could damage existing, in-use databases.
So I was wondering what the orthodox, Debian-ish approach might be. I can use a shell prompt from the postinst script, but if there's a better way I'd sooner do that. I should add that I know about "Ask Again", but that seems to only work as a global setting, and I'd sooner make this just for this package.
One last thing: this is an in-house system and never going to be hosted on public repos, so I'm not unduly worried about considerations like unattended installs or non-bash installation environments.
This has been bugging me for a couple of weeks now. Any help gratefully received.
Asked by nick_at_MHT
(23 rep)
Jun 20, 2019, 09:06 AM
Last activity: Jun 20, 2019, 01:45 PM
Last activity: Jun 20, 2019, 01:45 PM