On 2019-01-17 11:14, Adam Bolte wrote: > On Wed, Jan 16, 2019 at 11:43:57AM +0100, Aurelien Jarno wrote: > > I don't think the patch is correct. Debconf is not a registry, the > > canonical location for the configuration is the configuration files, not > > the debconf database. Quoting debconf-devel(7): > > > > "The issue to watch out for here is that debconf is not intended to be, > > and must not be used as a registry." > > > > I think it also applies when DEBCONF_RECONFIGURE is set. > > That's interesting, but also very confusing. If your assumption is > correct, what is the point of being able to run dpkg-reconfigure in > non-interactive mode?
Re-execute the postinst script with the new configuration. In the case of postinst, it would mean for example: $ echo Europe/London > /etc/timezone $ dpkg-reconfigure -fnoninteractive tzdata This ensures that the /etc/localtime symlink is correctly configured. If you look a bit on a search engine, it looks like a very common method to configure the timezone. > You can only reconfigure a package that is already installed, so (as I > understand it) if the debconf registry is supposed to be clobbered by > whatever the actual system configuration is before use, that would > mean `dpkg-reconfigure -fnoninteractive <package>` is a completely > useless and pointless command. > > Let's look at the dash package > > $ sudo debconf-get-selections | grep dash > # Use dash as the default system shell (/bin/sh)? > dash dash/sh boolean true > $ ls -l /bin/sh > lrwxrwxrwx 1 root root 4 Jan 24 2017 /bin/sh -> dash > $ echo dash dash/sh boolean false | sudo debconf-set-selections > $ sudo debconf-get-selections | grep dash > # Use dash as the default system shell (/bin/sh)? > dash dash/sh boolean false > $ sudo dpkg-reconfigure -fnoninteractive dash > Removing 'diversion of /bin/sh to /bin/sh.distrib by dash' > Adding 'diversion of /bin/sh to /bin/sh.distrib by bash' > Removing 'diversion of /usr/share/man/man1/sh.1.gz to > /usr/share/man/man1/sh.distrib.1.gz by dash' > Adding 'diversion of /usr/share/man/man1/sh.1.gz to > /usr/share/man/man1/sh.distrib.1.gz by bash' > $ ls -l /bin/sh > lrwxrwxrwx 1 root root 4 Jan 17 10:55 /bin/sh -> bash > $ > > The dash package reconfiguration has no issues modifying the system > configuration based on debconf. I would expect tzdata to behave in a > consistent manner with other packages. Let's look at another example, the locales package prefers debconf to the file configuration, just like to ask for tzdata. People consider that as a bug, see for example bug #793368. It doesn't seem to be possible to support both reconfiguration from preseed and from a config file at the same time. It seems some people expect one to work the other expect the other. I therefore prefer to not change the current behavior and keep the status quo. Also the current behavior implemented in tzdata seems to more or less match the "debconf ... must not be used as a registry". Aurelien -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurel...@aurel32.net http://www.aurel32.net
Description: PGP signature