salsa-ci.yml: Allow daemons to start during autopkgtest
The "official" docker image has a policy-rc.d
which always exits 101, preventing invoke-rc.d to start services.
Only removing /usr/sbin/policy-rc.d prints: invoke-rc.d: could not determine current runlevel invoke-rc.d: WARNING: No init system and policy-rc.d missing! Defaulting to block.
So a symlink to /bin/true (exit 0) is needed.
Merge request reports
Activity
mentioned in merge request samba-team/samba!10 (merged)
Would you mind explaining us what does this change helps you with?
On logbook, we had to restart a daemon manually because it wouldn't be running when the container starts. Does this change help with that?
https://salsa.debian.org/debian/logbook/blob/master/debian/tests/unittests
On a usual (i.e non-Docker) Debian installation, services are started from postinst by calling invoke-rc.d.
on docker, a
policy-rc.d
script always returns 101 which prevents services start.We don't want this behavior on autopkgtest, so we remove this script.
This is not sufficient as
invoke-rc.d
by default wants to know the run level (failing on docker as there is no proper int) otherwise its exit 101 too. The solution is to have apolicy-rc.d
script which always exit 0, i.e/bin/true
.mentioned in commit samba-team/samba@629b5678
If the policy-rc.d script is shipped by the "official" Docker image, it might be worth to consider alternative images (instead of working around its limitations). If I read https://changelog.complete.org/archives/9794-fixing-the-problems-with-docker-images correctly, some images do not offer a real init system, which of course makes testing packaged daemons harder than necessary.
mentioned in commit debian/smcroute@91635197
@micha I think my 2-lines fix is better than using another image.
I don't know if it's possible to use an init within gitlab-ci. Anyway, an init is not really needed as the container is removed afterward (killing zombies).
Hey @sathieu, despite your change make sense to me. I think it'd be better if you put that change permanently into the corresponding docker image https://salsa.debian.org/salsa-ci-team/images/blob/master/dockerfiles/autopkgtest.
Superseeded by images!10 (merged)