Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#79353 - [gitea] systemd service file fails to start after installation

Attached to Project: Arch Linux
Opened by JP (vic_acid) - Saturday, 12 August 2023, 06:37 GMT
Last edited by Robin Candau (Antiz) - Saturday, 12 August 2023, 11:24 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Robin Candau (Antiz)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
There is an apparent error in the service file for the gitea package in extra. When starting the service after a fresh installation of the package, the service will fail to start and the following appears in the journal:

Aug 10 18:17:07 new-alexandria systemd[1]: Started Gitea (Git with a cup of tea).
Aug 10 18:17:07 new-alexandria (gitea)[13701]: gitea.service: Failed to set up mount namespacing: /run/systemd/mount-rootfs/etc/gitea/app.ini: No such file or directory
Aug 10 18:17:07 new-alexandria (gitea)[13701]: gitea.service: Failed at step NAMESPACE spawning /usr/bin/gitea: No such file or directory
Aug 10 18:17:07 new-alexandria systemd[1]: gitea.service: Main process exited, code=exited, status=226/NAMESPACE
Aug 10 18:17:07 new-alexandria systemd[1]: gitea.service: Failed with result 'exit-code'.
Aug 10 18:17:09 new-alexandria systemd[1]: gitea.service: Scheduled restart job, restart counter is at 1.

I've tracked it down to the this line in the service file:

ReadWritePaths=/etc/gitea/app.ini

I could get the service to finally start so that I could configure the installation by changing that line to one of the following:

ReadWritePaths=-/etc/gitea/app.ini

... or ...

ReadWritePaths=/etc/gitea/

Further information can be found in my post in the forums:
https://bbs.archlinux.org/viewtopic.php?id=287934


Additional info:
* package version(s)
using the latest gitea package (1.20.2), latest kernel (6.4.9), latest systemd (254.1)
I also tried this with older versions of gitea, of systemd, and the current LTS kernel (6.1.44) -- all failed as well


Steps to reproduce:
1. pacman -Syu gitea
2. sudo systemctl start gitea
3. journalctl -ef will show repeated failed attempts to start and restart the gitea service with the above error messages
This task depends upon

Closed by  Robin Candau (Antiz)
Saturday, 12 August 2023, 11:24 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in gitea 1.20.2-3 by shipping the upstream example configuration file as the default configuration.
Comment by Robin Candau (Antiz) - Saturday, 12 August 2023, 11:13 GMT
Hi,

Thanks for reporting this issue. The actual problem isn't located in the systemd service file but it's that the package took assumption that the initial start of gitea would generate the `app.ini` config file (which may eventually have been the case at some point but is not anymore apparently).

I corrected the issue by packaging the default/example configuration file provided by upstream as the actual `app.ini` file and added to the backup array in the PKGBUILD:
- https://gitlab.archlinux.org/archlinux/packaging/packages/gitea/-/commit/abcfbeedd0410ff65cc06a34683684a15e905586
- https://gitlab.archlinux.org/archlinux/packaging/packages/gitea/-/commit/52f56dcbc8769b9be53300df487375608cf09f5f

That way, the package now provides a default configuration preventing the initial start from failing.
I also edited the wiki accordingly: https://wiki.archlinux.org/index.php?title=Gitea&diff=785282&oldid=779048

Loading...