Skip to content

How to set Restart=always for a socket unit? #11553

@lahwaacz

Description

@lahwaacz

Even socket units may fail, e.g. due to an out-of-memory situation, which may trigger errors like

systemd[1]: sshd.socket: Failed to fork off accept stub process: Cannot allocate memory

(The unit comes from Arch Linux openssh package.)

Since there is no "nice way to fix the root cause", setting Restart=always for the unit is needed to prevent losing access to headless hosts with difficult physical access, but that clause is valid only for services. Is there another way to have socket units always restart on failure?

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁Request for Enhancement, i.e. a feature requestpid1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions