#1005167 docker.io: Should start, not restart daemon on fresh install

Package:
docker.io
Source:
docker.io
Description:
Linux container runtime
Submitter:
Olaf Meeuwissen
Date:
2022-02-08 11:21:04 UTC
Severity:
normal
#1005167#5
Date:
2022-02-08 11:07:00 UTC
From:
To:
Dear Maintainer,

When running `apt install docker.io` installation fails with

  [...]
  invoke-rc.d: initscript docker, action "restart" failed.
  dpkg: error processing package docker.io (--configure):
   installed docker.io package post-installation script subprocess returned error exit status 1
  [...]
  Errors were encountered while processing:
   docker.io

This happens because there is no daemon running yet that can be
restarted.  I cleaned up with

  invoke-rc.d docker start
  dpkg --configure docker.io

but the post-install script should check whether it is a fresh install
or upgrade to decide what should be done.  Actually, I think even in the
case of an upgrade it should check whether the daemon is running.  If
not, perhaps it should not start the daemon as it may have been stopped
by the sysadmin for some reason.