Skip to content

synchronization target usage in services which are not always run as a part of the boot or shutdown #21

@geissonator

Description

@geissonator

Ran into an architecture'ish type problem recently. There is a service, that is a part of the power off, but is also a part of the host quiesce. This service utlizes a power off synchronization target:

Wants=obmc-host-stop-pre@%i.target
Before=obmc-host-stop-pre@%i.targe

So say you power on your system, and just run this service on it's own. You actually end up starting all of the synchronization targets!

May 27 19:55:24 p10bmc systemd[1]: Reached target Stop Host0 (Pre).
May 27 19:55:24 p10bmc systemd[1]: Reached target Host0 (Stopping).
May 27 19:55:24 p10bmc systemd[1]: Reached target Host0 (Stopped).

And then, if you issue an actual power off, all of the synchronization targets have started so you have no synchronization!

The real world example we (IBM) hit this on was with the [email protected]. This service is called when the host goes to the Quiesce state. After Quiesce, the host-state-manager initiates a reboot of the host firmware, which starts the power off process. That power off process no longer has the synchronization targets to coordinate the power down.

I see a few potential solutions:

  • Don't allow a service that is not run in the power on or power off targets to use synchronization targets (make them explicitly set their service dependencies) (probably the best short term solution)
  • Ensure that when the power on or off targets are started, they stop all of the synchronization targets (not real sure how we'd do this, some service that runs first?)
  • Get rid of synchronization targets and just do explicit service to service dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions