Bug#801065: service failures should not fail dpkg installation: https://lists.debian.org/debian-devel/2015/09/msg00532.html

Holger Levsen <[email protected]> Sat, 13 Jun 2026 09:01:38 +0000
Newsgroups gmane.linux.debian.devel.policy
Message-ID <ai0ccq8oYYX8dmec__27479.9385386117$1781341409$gmane$org@layer-acht.org>
--W2h6f6Zd1zsl76AF
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Serafi,

On Fri, Jun 12, 2026 at 10:03:32PM +0200, Serafeim (Serafi) Zanikolas wrote:
> > thanks for the updated patch. What I still miss is the information firs=
t,
> > that postinst scripts normally must not fail. Or is it there and just m=
issing
> > from the patch/context?
> nope, you're right. please find attached a revised patch.

thanks, better, however:

> +Expected behavior of complex postinst scripts
> +------------------------------------------------------------------------=
--------------------------------------------------------
> +``postinst`` scripts must normally not fail,=20

I'd add the information here that it makes the package seriously buggy
if the package fails to install due to this, eg in piuparts testing but
also in other cases.

> +``postinst`` scripts must normally not fail, except for very specific ca=
ses when
> +a package is clearly broken:
> +-  A service failing to start upon a fresh install if:
[...]
> +-  A service failing to restart upon an upgrade if:
[...]

Honestly I fail to parse the English here, though from context of the bug=
=20
report I do get what you mean with these constructs.

Also, I dont think "a package is clearly broken" is correct, its the enviro=
nment
or something else which is broken, not the package.

So how about something like:

``postinst`` scripts must normally not fail, except for very rare cases:

- failing to start upon a fresh install when:
   - the service configuration is straightforward and can be reasonably
     expected to work as-is in typical Debian setups
   - the service has no external dependencies (e.g. a database which may not
     yet be configured, or unreachable at install time)

NOTE: and now I see these are conditions when the packages must NOT fail.

So another attempt:


``postinst`` scripts must normally not fail, except for very rare cases.
These are cases where postinst must succeed:

on fresh installs:
   - the service configuration is straightforward and can be reasonably
     expected to work as-is in typical Debian setups
   - the service has no external dependencies (e.g. a database which may not
     yet be configured, or unreachable at install time)

on upgrades:
   - ``postinst`` can verify with high confidence (which may not always be
     feasible) that the service was running prior to the restart
   - the service has no external dependencies or ``postinst`` can verify th=
at
     they are functional
   - the service configuration has not changed in backwards incompatible wa=
ys
     between the old and new package versions


what do you think?


--=20
cheers,
	Holger

 =E2=A2=80=E2=A3=B4=E2=A0=BE=E2=A0=BB=E2=A2=B6=E2=A3=A6=E2=A0=80
 =E2=A3=BE=E2=A0=81=E2=A2=A0=E2=A0=92=E2=A0=80=E2=A3=BF=E2=A1=81  holger@(d=
ebian|reproducible-builds|layer-acht).org
 =E2=A2=BF=E2=A1=84=E2=A0=98=E2=A0=B7=E2=A0=9A=E2=A0=8B=E2=A0=80  OpenPGP: =
B8BF54137B09D35CF026FE9D 091AB856069AAA1C
 =E2=A0=88=E2=A0=B3=E2=A3=84

Kinda weird that we=E2=80=99re all gonna experience climate change as a ser=
ies of
short, apocalyptic videos until eventually it=E2=80=99s your phone that=E2=
=80=99s recording.
(@shocks)

--W2h6f6Zd1zsl76AF
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEuL9UE3sJ01zwJv6dCRq4VgaaqhwFAmotHG4ACgkQCRq4Vgaa
qhzqJw/9HkSAl8ivLWFGcLya/vP09Cfux1WQZUbNfsErDU9aOxQcpXytOmPpmM4g
hZxNzuycv+DUXZOjWVOY3JuKCjN/7ITUkqqaIm1rrCHqU/SPkKwLsqxtu4KqHuCZ
Bp/1O1h5WAqZZYsnEJ7BLnOzDTM8IDy2XpHVfAmj6OGEuW5YqmWriHWYkXezoeqV
Z4XEEaOymllEOulBihuSFPQNkQxvUjVbhiOthLQzOlzmsnJQUoee54qLOWEZUGtT
MiIbGO398o+cdcwJ/ID03bD1aULwhElJ6drO/9MVBTvt4EbJIrdH/CfSfdWs0KIH
svszxeMWNYQqoZ3rlyrgydRslGXJykZZWsg015prEAh0froWegLqY56QbDW5PY6a
Kg0m/hER2gQnAC1trXkxqTj4nYXuRSsSzbBe25kYT9RgwVZv1esZNM+jkOaIan4u
p1+DrfTuX2sQbCjlAehfERt52NI2YwiwUclf1T8r+VRGyiCdriYEpNq0GgYRVG+b
j5jKPXXjtFIpEC+xjHRyIVuO8fNubCS7jSWXWhrXxg/G3Cax43YoCW8/4tVLUM36
oIA1ynUoJInxqDdRPwNBp19Yx1A5xlMW1oz2e5GNOsZrkcDX/r7qdel5RcLnE+bi
gzKiCbOMJvoH1D1puiK9pQcx9NI66z1wrc5SGcYwx0K1/a/Pp0A=
=c/RL
-----END PGP SIGNATURE-----

--W2h6f6Zd1zsl76AF--