gitea.service not starting on boot #7508

Closed
opened 2025-11-02 07:27:59 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @RolfNoot on GitHub (Jun 25, 2021).

  • Gitea version (or commit ref): 1.14.3
  • Git version: 2.17.1
  • Operating system: Ubuntu 18.04.4 LTS
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Log gist:

Description

The gitea service doesn't start on boot, it fails with "Found ordering cycle" on boot (see log below). When I start manually after boot, the service starts well.

LOG

systemd[1]: sockets.target: Found ordering cycle on gitea.service/start
systemd[1]: sockets.target: Job gitea.service/start deleted to break ordering cycle starting with sockets.target/start

Originally created by @RolfNoot on GitHub (Jun 25, 2021). <!-- 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. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.14.3 - Git version: 2.17.1 - Operating system: Ubuntu 18.04.4 LTS <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description <!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services. --> The gitea service doesn't start on boot, it fails with "Found ordering cycle" on boot (see log below). When I start manually after boot, the service starts well. ## LOG systemd[1]: sockets.target: Found ordering cycle on gitea.service/start systemd[1]: sockets.target: Job gitea.service/start deleted to break ordering cycle starting with sockets.target/start
GiteaMirror added the type/questionissue/needs-feedback labels 2025-11-02 07:27:59 -06:00
Author
Owner

@zeripath commented on GitHub (Jun 25, 2021):

We would need to see your service file.

@zeripath commented on GitHub (Jun 25, 2021): We would need to see your service file.
Author
Owner

@zeripath commented on GitHub (Jun 25, 2021):

It's worth noting that this isn't a bug with gitea but a problem with your systemd configuration.

@zeripath commented on GitHub (Jun 25, 2021): It's worth noting that this isn't a bug with gitea but a problem with your systemd configuration.
Author
Owner

@RolfNoot commented on GitHub (Jun 25, 2021):

Yes, I get that it's a configuration problem. I took the gitea.service as provided by the documentation and changed it accordingly. I can see that systemd tried to start the service and that it failed.
gitea.service

@RolfNoot commented on GitHub (Jun 25, 2021): Yes, I get that it's a configuration problem. I took the gitea.service as provided by the documentation and changed it accordingly. I can see that systemd tried to start the service and that it failed. [gitea.service](https://github.com/go-gitea/gitea/files/6718272/gitea.service.txt)
Author
Owner

@zeripath commented on GitHub (Jun 25, 2021):

Have you changed other systemd configuration?

Do you have a mysql.service?

Have you created a socket activation?

@zeripath commented on GitHub (Jun 25, 2021): Have you changed other systemd configuration? Do you have a mysql.service? Have you created a socket activation?
Author
Owner

@RolfNoot commented on GitHub (Jun 25, 2021):

  1. It runs on a system which runs other services as well. Some other services have been installed before.
  2. There's no mysql service.
  3. Maybe another service uses socket activation, I don't know the details of what's installed previously.

Let me note that when starting the service after boot, it succeeds.

@RolfNoot commented on GitHub (Jun 25, 2021): 1. It runs on a system which runs other services as well. Some other services have been installed before. 2. There's no mysql service. 3. Maybe another service uses socket activation, I don't know the details of what's installed previously. Let me note that when starting the service after boot, it succeeds.
Author
Owner

@zeripath commented on GitHub (Jun 25, 2021):

2 .There's no mysql service.

Well that's your problem:

[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
###
# Don't forget to add the database service dependencies
###
#
Wants=mysql.service
After=mysql.service
...

You explicitly depend on the mysql.service here. Comment these two lines out.

@zeripath commented on GitHub (Jun 25, 2021): > 2 .There's no mysql service. Well that's your problem: ```systemd [Unit] Description=Gitea (Git with a cup of tea) After=syslog.target After=network.target ### # Don't forget to add the database service dependencies ### # Wants=mysql.service After=mysql.service ... ``` You explicitly depend on the mysql.service here. Comment these two lines out.
Author
Owner

@RolfNoot commented on GitHub (Jun 25, 2021):

Sorry, I didn't see the service listed at /etc/systemd/system/ However if I do service --status-all, this is my output:

 [ - ]  acpid
 [ + ]  apparmor
 [ + ]  apport
 [ + ]  atd
 [ - ]  console-setup.sh
 [ + ]  cron
 [ - ]  cryptdisks
 [ - ]  cryptdisks-early
 [ + ]  dbus
 [ + ]  ebtables
 [ + ]  grub-common
 [ - ]  hwclock.sh
 [ - ]  irqbalance
 [ + ]  iscsid
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ - ]  lvm2
 [ + ]  lvm2-lvmetad
 [ + ]  lvm2-lvmpolld
 [ + ]  lxcfs
 [ - ]  lxd
 [ - ]  mdadm
 [ - ]  mdadm-waitidle
 [ + ]  mosquitto
 [ + ]  mysql
 [ + ]  netfilter-persistent
 [ + ]  nginx
 [ - ]  open-iscsi
 [ - ]  open-vm-tools
 [ - ]  plymouth
 [ - ]  plymouth-log
 [ + ]  postgresql
 [ + ]  procps
 [ + ]  redis-server
 [ - ]  rsync
 [ + ]  rsyslog
 [ - ]  screen-cleanup
 [ + ]  ssh
 [ + ]  sysstat
 [ + ]  udev
 [ + ]  ufw
 [ + ]  unattended-upgrades
 [ - ]  uuidd
@RolfNoot commented on GitHub (Jun 25, 2021): Sorry, I didn't see the service listed at `/etc/systemd/system/` However if I do `service --status-all`, this is my output: ``` [ - ] acpid [ + ] apparmor [ + ] apport [ + ] atd [ - ] console-setup.sh [ + ] cron [ - ] cryptdisks [ - ] cryptdisks-early [ + ] dbus [ + ] ebtables [ + ] grub-common [ - ] hwclock.sh [ - ] irqbalance [ + ] iscsid [ - ] keyboard-setup.sh [ + ] kmod [ - ] lvm2 [ + ] lvm2-lvmetad [ + ] lvm2-lvmpolld [ + ] lxcfs [ - ] lxd [ - ] mdadm [ - ] mdadm-waitidle [ + ] mosquitto [ + ] mysql [ + ] netfilter-persistent [ + ] nginx [ - ] open-iscsi [ - ] open-vm-tools [ - ] plymouth [ - ] plymouth-log [ + ] postgresql [ + ] procps [ + ] redis-server [ - ] rsync [ + ] rsyslog [ - ] screen-cleanup [ + ] ssh [ + ] sysstat [ + ] udev [ + ] ufw [ + ] unattended-upgrades [ - ] uuidd ```
Author
Owner

@RolfNoot commented on GitHub (Jun 25, 2021):

Sorry for bothering, I finally find out that after a systemctl daemon-reload everything works well!

Thanks!

@RolfNoot commented on GitHub (Jun 25, 2021): Sorry for bothering, I finally find out that after a `systemctl daemon-reload` everything works well! Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7508