Skip to content

UpheldBy restarts unit even when manually stopped #35636

@aksiksi

Description

@aksiksi

Component

systemctl, systemd

Is your feature request related to a problem? Please describe

Suppose I have two units db.service and app.service, where app has:

After=db.service
Requires=db.service
UpheldBy=db.service

The reason for this config is to ensure that app is stopped when db is stopped, but also restarted when db is restarted.

However, it seems UpheldBy also applies if app is manually stopped via systemctl.

This behavior is surprising to me, but maybe intentional. Or perhaps systemd doesn't differentiate between manual and automated in general.

Describe the solution you'd like

A more concrete example where I have two Podman containers running as systemd services:

$ sudo systemctl list-dependencies podman-tubesync.service
podman-tubesync.service
...
● ├─podman-tubesync-db.service

If I manually stop podman-tubesync.service, I'd expect it to stay stopped until started again (manually) rather than continually restart due to UpheldBy=podman-tubesync-db.service.

Describe alternatives you've considered

No response

The systemd version you checked that didn't have the feature you are asking for

256.8

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions