After install the Gitea, start/enable gitea.service do not work!!! #6037

Closed
opened 2025-11-02 06:43:21 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @GitYun on GitHub (Sep 23, 2020).

  • Gitea version (or commit ref): Gitea version 1.12.4 built with GNU Make 4.3, go1.15.1 : bindata, sqlite, sqlite_unlock_notify, pam
  • Git version: 2.28.0
  • Operating system: ArchLinuxARM
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Started Gitea (Git with a cup of tea).
systemd[480]: gitea.service: Changing to the requested working directory failed: Permission denied
systemd[480]: gitea.service: Failed at step CHDIR spawning /usr/bin/gitea: Permission denied
systemd[1]: gitea.service: Main process exited, code=exited, status=200/CHDIR
systemd[1]: gitea.service: Failed with result 'exit-code'.
systemd[1]: gitea.service: Scheduled restart job, restart counter is at 20.
systemd[1]: Stopped Gitea (Git with a cup of tea).

Description

After install the Gitea, start/enable gitea.service do not work!!!

Screenshots

image

image

Originally created by @GitYun on GitHub (Sep 23, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): Gitea version 1.12.4 built with GNU Make 4.3, go1.15.1 : bindata, sqlite, sqlite_unlock_notify, pam - Git version: 2.28.0 - Operating system: ArchLinuxARM - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [ ] Not relevant - Log gist: Started Gitea (Git with a cup of tea). systemd[480]: gitea.service: Changing to the requested working directory failed: Permission denied systemd[480]: gitea.service: Failed at step CHDIR spawning /usr/bin/gitea: Permission denied systemd[1]: gitea.service: Main process exited, code=exited, status=200/CHDIR systemd[1]: gitea.service: Failed with result 'exit-code'. systemd[1]: gitea.service: Scheduled restart job, restart counter is at 20. systemd[1]: Stopped Gitea (Git with a cup of tea). ## Description After install the Gitea, start/enable `gitea.service` do not work!!! ## Screenshots ![image](https://user-images.githubusercontent.com/17734146/93976183-2928dc00-fdab-11ea-8eb8-45ceb9faf41a.png) ![image](https://user-images.githubusercontent.com/17734146/93976263-4fe71280-fdab-11ea-8950-aba5ea2cf3d5.png) <!-- **If this issue involves the Web Interface, please include a screenshot** -->
Author
Owner

@Masgalor commented on GitHub (Sep 23, 2020):

First of all you should definitly add more exclamation marks to your issue title, it is very importent to have enough of those in your title and description.

Joking aside.
The error message clearly states the problem, I dont even know how to express this any better.

systemd[480]: gitea.service: Changing to the requested working directory failed: Permission denied
systemd[480]: gitea.service: Failed at step CHDIR spawning /usr/bin/gitea: Permission denied

The user you are running gitea with does not have the permission to use the working directory /usr/bin/gitea.
So either you entered the wrong directory in your config, or the directorys ownership/permissions are wrong.

@Masgalor commented on GitHub (Sep 23, 2020): First of all you should definitly add more exclamation marks to your issue title, it is very importent to have enough of those in your title and description. Joking aside. The error message clearly states the problem, I dont even know how to express this any better. > systemd[480]: gitea.service: Changing to the requested working directory failed: Permission denied > systemd[480]: gitea.service: Failed at step CHDIR spawning /usr/bin/gitea: Permission denied The user you are running gitea with does not have the permission to use the working directory `/usr/bin/gitea`. So either you entered the wrong directory in your config, or the directorys ownership/permissions are wrong.
Author
Owner

@GitYun commented on GitHub (Sep 24, 2020):

@Masgalor:
Yes, thank you very much!
I know it’s a permission problem, but I tried to change the permissions and owners of some files, but it’s still useless, and it doesn’t seem to find the root cause.

Today I tried to change the content of the ‘gitea.service’ file again, and then after using ‘systemctl daemon-reload’, I restarted the service and it worked correctly!!!
I seem to have forgotten to use ‘systemctl daemon-reload’ before.

According to what you said the 'user' don't have permission to use /usr/bin/gitea, it should work if its owner is changed. I will try this way later.

Thanks again! ! !

@GitYun commented on GitHub (Sep 24, 2020): @Masgalor: Yes, thank you very much! I know it’s a permission problem, but I tried to change the permissions and owners of some files, but it’s still useless, and it doesn’t seem to find the root cause. Today I tried to change the content of the ‘gitea.service’ file again, and then after using ‘systemctl daemon-reload’, I restarted the service and it worked correctly!!! I seem to have forgotten to use ‘systemctl daemon-reload’ before. According to what you said the 'user' don't have permission to use /usr/bin/gitea, it should work if its owner is changed. I will try this way later. Thanks again! ! !
Author
Owner

@jolheiser commented on GitHub (Sep 24, 2020):

Closing this, seems you found a solution. 🙂

@jolheiser commented on GitHub (Sep 24, 2020): Closing this, seems you found a solution. 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6037