Skip to content

pid1: accept single transaction to operate multiple units #8102

Closed

Description

@johnlinp

Submission type

  • Request for enhancement (RFE)

systemd version the issue has been seen with

tested on v235, but all versions should have the same behavior

Used distribution

Arch Linux

In case of bug report: Expected behaviour you didn't see

systemctl first.service second.service should have the same behavior as systemctl second.service first.service.

In case of bug report: Unexpected behaviour you saw

The behaviors are different.

In case of bug report: Steps to reproduce the problem

  1. Create 2 service unist: first.service and second.service and configured After=first.service in second.service. Both services are Type=oneshot.
  2. Execute systemctl start first.service second.service. The ordering dependency will work, i.e. second.service will start after first.service.
  3. Execute systemctl start second.service first.service. first.service and second.service will start at the same time.

This is because systemctl doesn't operate those units in a single transaction since there are no such API provided by pid1.

It's from the mailing list: https://lists.freedesktop.org/archives/systemd-devel/2018-January/040122.html.

Activity

  1. added
    RFE 🎁
    on Feb 5, 2018
  2. Werkov commented on Nov 23, 2018

    @Werkov
    Contributor

    Some ideas that came to my mind:

    1. Create a temporary (internal) target that would aggregate all the units passed through systemctl CLI
    • unclear management of that unit
    • works for systemctl only, not DBus API
    1. Allow "vectorized" operations
    • DBus API methods like StartUnit -> StartUnits
    • transaction engine ensures the jobs are created within the same transaction
    1. Allow aggregating multiple jobs
    • DBus API methods like BeginJobsGroup, EndJobsGroup and insert operations between those
    • stateful communication, could be abused to DOS (PID would need limits of on groups in flight)

    What are you opinions? Are there any other approaches?

    I'm pursuing number 2) in single-tx-jobs but I'd like to hear some opinion before touching the DBus API.

  3. added
    downstream/rhel
    on Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁downstream/rhelpid1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions