Skip to content

"Requisite" dependency fails with "device" units - and with "After" ordering, produces "crazy" errors #4756

@thx1111

Description

@thx1111
  • Bug report
  • Request for enhancement (RFE)

systemd 232-3

Arch

When it is convenient to have a WantedBy=some-other-unit dependency in addition to a
WantedBy= sys-subsystem-net-devices-%p.device

then it would seem necessary to qualify the Start from some-other-unit with a
Requisite= sys-subsystem-net-devices-%p.device

so that the unit does NOT actually start when no such device actually exists yet.

Instead, the Requisite=...device dependency has no effect whatsoever, and systemd will attempt to start the unit whether the device exists or not.

Additionally, in issue #4256, there is the statement that, "we should also point out in the man page explicitly that Requisite needs to be combined with After= to be useful".

Instead, combining:
Requisite= sys-subsystem-net-devices-%p.device
After= sys-subsystem-net-devices-%p.device

produces "crazy" systemd errors, in the nature of:
systemd[1]: [email protected]: Main process exited, code=killed, status=15/TERM
systemd[1]: Stopped Enslaved enp0s7@bond0.
systemd[1]: [email protected]: Unit entered failed state.
systemd[1]: [email protected]: Failed with result 'signal'.
systemd[1]: Requested transaction contradicts existing jobs: Resource deadlock avoided
systemd[1]: Requested transaction contradicts existing jobs: Resource deadlock avoided
systemd[1]: Requested transaction contradicts existing jobs: Resource deadlock avoided

such that the entire unit start fails. What this "Resource deadlock" might be is a unknown, with a useless "opaque" error message.

It is reasonable to expect that systemd would not "try" to start a unit with a Requisite device dependency when that device does not exist!

And it makes no sense to involve some ordering dependency when Start/Stop dependencies are expected to be "orthogonal" to, and independent of, ordering dependencies!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions