Skip to content

dev: consolidate common fake systemctl & service scripts. #2105

@JedMeister

Description

@JedMeister

Low priority but nice "tidy up"...

At appliance build time there is sometimes need to start services. However systemd services will not run in a chroot. We workaround this by providing a fake systemctl script - with a companion service script.

The fake scripts are added to the system during the first step of the root.patched step (common overlay) and then removed at the end of the root.patched build step as a final-removelist. I.e. before and after all the conf scripts run respectively.

Currently the functionality is split between the 2 "fake" systemctl and service scripts in a very adhoc way. That just happened organically over the years because during the systemd transition many packages still included sysvinit scripts so service would often still "just work" in a chroot. When systemd is not running, service triggered the init.d script rather than the service file. However as systemd has become more ubiquitous that has become less the case and most packages no longer even include init.d scripts. And some that still remain explicitly invoke systemd anyway (e.g. Apache).

So it makes much more sense to consolidate all the functionality into a single systemctl script. I.e. move all the functionality from our fake service to our fake systemctl.

The first step would be to replace all build time conf script calls to service with systemctl. Once that is complete we can just remove our fake service command altogether. Fake systemctl should probably still check if an init.d script exists and call that via service if it does (while Debian still includes some) - but that too could be in fake systemctl.

Metadata

Metadata

Assignees

No one assigned

    Labels

    commonBugs/feature requests that require changes to shared common build codedevpaintkldevwishlist

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions