-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitea.service systemd script doesn't work on Ubuntu #27422
Comments
Maybe #21151 has some problems. |
Based on this comment I believe you are correct. |
After switching to the latest/stable(1.21.5) snap package, the Gitea indeed kept rebooting. The
|
I believe snap has its own built-in service manager, |
That being the case, perhaps this is as simple as updating the docs to reflect that. NOTE: I have confirmed that if I install the latest Gitea binary directly without using snap, the service will run as expected. So it is either a bug with the 1.20.4 version or a limitation of the snap package. |
Thanks for the suggestion @TheFriendlyCoder. @lng2020 sent a PR to the docs to update them. I'll close this now :) |
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 thesystemctl 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
The text was updated successfully, but these errors were encountered: