Skip to content
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

Systemd needs After as well as Require #15881

Merged

Conversation

zeripath
Copy link
Contributor

If the Gitea service is stopped because of the db going down
it needs an After=db.service to ensure it is restarted in
addition to the Requires=db.service to ensure that the db
is started before Gitea is started.

Fix #15866

Signed-off-by: Andrew Thornton art27@cantab.net

If the gitea service is stopped because of the db going down
it needs an `After=db.service` to ensure it is restarted in
addition to the `Requires=db.service` to ensure that the db
is started before gitea is started.

Fix go-gitea#15866

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.15.0 milestone May 15, 2021
@codecov-commenter
Copy link

codecov-commenter commented May 15, 2021

Codecov Report

Merging #15881 (5ac07e7) into main (e0c93fe) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #15881   +/-   ##
=======================================
  Coverage   44.01%   44.02%           
=======================================
  Files         681      681           
  Lines       82333    82333           
=======================================
+ Hits        36241    36244    +3     
+ Misses      40189    40188    -1     
+ Partials     5903     5901    -2     
Impacted Files Coverage Δ
models/repo_list.go 77.04% <0.00%> (-0.78%) ⬇️
models/gpg_key.go 54.07% <0.00%> (+0.56%) ⬆️
modules/avatar/avatar.go 52.27% <0.00%> (+4.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41136db...5ac07e7. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 15, 2021
@noerw
Copy link
Member

noerw commented May 15, 2021

This doesn't fix it for me. I'll wait to see how it behaves with unattended upgrades, but when doing the following manually gitea doesn't come up again:

systemctl daemon-reload
systemctl start gitea
systemctl stop mysql
systemctl status gitea # inactive (dead)
systemctl start mysql
systemctl status gitea # inactive (dead)

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 15, 2021
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 16, 2021
@lunny lunny merged commit 3a04d6f into go-gitea:main May 16, 2021
@zeripath zeripath deleted the fix-15866-change-suggested-service-definition branch May 16, 2021 09:21
@noerw
Copy link
Member

noerw commented May 16, 2021

@lafriks @lunny soo.. your approvals mean that you couldn't reproduce what I described in #15881 (comment)?

@lunny
Copy link
Member

lunny commented May 16, 2021

@lafriks @lunny soo.. your approvals mean that you couldn't reproduce what I described in #15881 (comment)?

Sorry, haven't noticed your reply. I haven't tested it in a real test environment just think it's right in theory and maybe it hasn't fixed #15866 so we can reopen it.

@lafriks lafriks added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label May 17, 2021
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 10, 2021
If the gitea service is stopped because of the db going down
it needs an `After=db.service` to ensure it is restarted in
addition to the `Requires=db.service` to ensure that the db
is started before gitea is started.

Fix go-gitea#15866

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. topic/deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

systemd: gitea.service not started after database upgrade
6 participants