Skip to content

gitea.service systemd script doesn't work on Ubuntu #27422

Closed
@TheFriendlyCoder

Description

@TheFriendlyCoder

Description

According to the docs one should be able to install Gitea on Ubuntu using snap and then launch the app via a systemd service using the sample service file found here, however based on my recent test deployment on Ubuntu 22.04 this does not work.

After spending some time debugging the problem, it seems the issue comes down to the Type=notify setting in the config file. Based on what I'm seeing, this setting is expecting the Gitea app to send a signal to systemd to notify it when the service is running, but this never actually happens, so systemd assumes the service is hung and times out after a while. Except, after the systemctl start gitea operation fails, the service itself is actually running fine.

Further, in order to side-step this problem in my environment I've simply changes the Type property to Type=simple, which allows the application to launch in the background, so that systemd isn't left waiting for a response from gitea. This is less than ideal because errors in the gitea startup sequence can go unnoticed, but at least it allows the service to start in a best-case scenario.

Gitea Version

Gitea version 1.20.5 built with GNU Make 4.3, go1.21.1 : bindata, sqlite, sqlite_unlock_notify, pam, cert

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

git version 2.34.1

Operating System

Ubuntu 22.04.3 LTS

How are you running Gitea?

As a systemd service.

Database

SQLite

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