Bug#802780: systemd: systemctl 227 fails in chroots (instead of ignoring)
Martin Pitt
mpitt at debian.org
Fri Oct 23 16:10:36 BST 2015
Hello Stephan,
Stephan Suerken [2015-10-23 13:32 +0000]:
> with 227-2 (not found in 226-2), systemctl behaves differently
> in chroots for (at least) services that only provide a sysv init
> script, breaking package install or removal:
> 226-2, jessie: Ignored, retval 0:
> # root? systemctl restart non-existing.service
> Running in chroot, ignoring request.
> # root? systemctl restart wicd.service
> Running in chroot, ignoring request.
>
> 227-2, sid: Fails, retval 6:
> # root? systemctl restart non-existing.service
> Failed to restart non-existing.service: Unit non-existing.service failed to load: No such file or directory.
> # root? systemctl restart non-existing.service
> Failed to restart non-existing.service: Unit non-existing.service failed to load: No such file or directory.
That looks right -- systemctl is supposed to fail for a nonexisting
script. I don't even consider that a bug, but a fix.
> As systemctl is also run implicitely via invoke.rc.d on postinst
> etc., this actually breaks package installation/removal on such
> systems (one current example is the wicd package).
Starting/stopping services in a schroot has never been defined
behaviour, as in general you can't do that. chroots should have a
policy-rc.d (see /usr/share/doc/sysv-rc/README.policy-rc.d.gz) which
disables service starting/stopping from package maintainer scripts.
mk-sbuild, pbuilder, and related utilities create such a policy-rc.d
by default.
Also, package maintainer scripts certainly shouldn't call invoke-rc.d
on a nonexisting service?
Thanks,
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
More information about the Pkg-systemd-maintainers
mailing list