Am 09.10.23 um 11:17 schrieb Michael Biebl:
On Thu, 5 Oct 2023 15:45:38 -0600 Bob Proulx <b...@proulx.com> wrote:
Holger Levsen wrote:
> Bob Proulx wrote:
> > The introduction of systemctl is problematic especially when used in
> > chroots.
>
> systemctl handles chroots, so can you elaborate on this?

The policy-rc.d layer was created so that dpkg upgrading packages in
chroots don't start daemons in the chroot that might be installed in
the chroot but for which we don't want them to be running in the
chroot.  Unless we do.  In either case we can control that using the
policy-rc.d layer which is entered through the invoke-rc.d command.
Therefore packaged actions such as from postinst and logrotate.d and
should call through invoke-rc.d which might do nothing if policy-rc.d
has been configured for them to do nothing.  So that upgrading
packages in a chroot won't start daemons there.

That so far is correct. The policy-rc.d/invoke-rc.d layer was designed having the package installation phase in mind, i.e. the use case for invoke-rc.d are maintainer scripts.

It was not meant as a general abstraction layer to start services, especially during boot, and also not during runtime outside a package installation context.

As you correctly noticed, in a chroot, you don't really want start any services. But for systemctl that is not an issue:

# systemctl start rsyslog
Running in chroot, ignoring command 'start'
# echo $?
0



And in a chroot, cron would not be running anyway, so the point about postrotate scripts being called is kinda moot.

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to