[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#801065: Documenting how to not fail postinst on service fails to start



On Sat, 2023-02-11 at 21:12 -0800, Russ Allbery wrote:
> An interesting problem case is a package whose point is to run a service,
> but which requires mandatory and not-automatable setup before the service
> can usefully run.  After package installation, the service cannot start.
> So the options are either attempt to start the service as normal in the
> postinst but ignore the failure, or add some more complex logic to
> postinst to attempt to determine whether the service has been set up
> properly and only attempt to start the service if it has.

Just do not enable the systemd unit for the service by default for such
services.

If an admin has configured and enabled then the service will be
(re)started. If the admin has not done anything then the service will
not be started and there is no error to ignore.

You need to do that for "automatable setup" too if the automation means
debconf as the admin might not have answered to the questions, for
example when the package is installed in an automated setup ;-)

Ansgar


Reply to: