base-passwd marked as Essential: yes but other packages depend on it being configured.
Hi,
base-passwd is marked as Essential: yes
However, it actually creates the initial passwd and group files in the preinst
script.
At least two other packages depend on this initial passwd file but do
not explicitly state a dependency on this package (because it's marked
essential)
passwd.postinst
if ! getent group shadow | grep -q '^shadow:[^:]*:42'
base-files.postinst
multiple calls to chown.
I am unsure what else amongst Essential: yes, Priority: required
packages might also have a dependency on the existence of /etc/passwd.
Packages like apt call chown as part of their postinst script
although in the apt case it's only called on an upgrade therefore
/etc/passwd must already exist. I haven't checked every other case where
chown is called.
debootstrap appears to work around this missing dependency by having an
explicit ordering of the configuration of the first few packages, in
particular it configures base-passwd first of all and then base-files,
even though base-files has a Pre-Depends on awk (and debootstrap has to
manually install the symlink for awk)
For the most part, apt/dpkg actually gets the configuration order
correct other than needing explicit dependencies added for passwd and
base-files. It's not obvious to me why deboostrap doesn't configure mawk
first (I'm guessing it's a legacy thing)
I think that passwd and base-files at least should have an explicit
dependency on base-password and, once that is in place any any other
places identified, the Essential: yes flag on base-password should be
removed.
I opened https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983251 before
I fully investigated this.
(I cannot see a way to make base-passwd really Essential: yes other than
bizarre ideas like making /etc/passwd a conffile - which would then
trigger annoying warnings on upgrade and "installing the package
maintainers version" would break systems!)
Regards,
Tim.
Reply to: