Skip to content

systemd: gitea.service not started after database upgrade #15866

@silverwind

Description

@silverwind

In the systemd service we recommend a Requires= dependency, but it seems this causes a issue with the service not being started back up when apt upgrades the database dependency. I observed the following sequence with such a configuration during a unattended APT upgrade of mysql.service on Ubuntu 20.04.2 using systemd 245:

May 13 06:34:13 systemd[1]: Stopping Gitea (Git with a cup of tea)...
May 13 06:34:13 systemd[1]: Stopping MySQL Community Server...
May 13 06:34:14 systemd[1]: Stopped MySQL Community Server.
May 13 06:34:14 systemd[1]: Stopped Gitea (Git with a cup of tea).
May 13 06:34:39 systemd[1]: Starting MySQL Community Server...
May 13 06:34:40 systemd[1]: Started MySQL Community Server.

Essentially gitea.service is not started up again after the database upgrade for unknown reason.

I don't fully understand why systemd would not bring up gitea.service in such a case, but I think we may want to consider using Wants= instead of Requires= to indicate a "weak" dependency which may help in such a case, or find out what systemd exactly does here.

https://unix.stackexchange.com/questions/375091 sounds like the same issue but I don't think the solution is acceptable.

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