Skip to content

Propose an explanation how to restart gracefully gitea after an update #10866

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

Merged
merged 10 commits into from
Apr 30, 2020

Conversation

camlafit
Copy link
Contributor

This documentation patch propose to be more clear about kill action.

Gitea support -1 signal to gracefully stop its actions.
Thanks to @zeripath about his explanations

@techknowlogick techknowlogick added the type/docs This PR mainly updates/creates documentation label Mar 28, 2020
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 28, 2020
* Add a note about a simple kill
@codecov-io
Copy link

Codecov Report

Merging #10866 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10866      +/-   ##
==========================================
+ Coverage   43.40%   43.42%   +0.02%     
==========================================
  Files         593      593              
  Lines       83271    83276       +5     
==========================================
+ Hits        36140    36162      +22     
+ Misses      42640    42623      -17     
  Partials     4491     4491              
Impacted Files Coverage Δ
services/pull/check.go 50.00% <0.00%> (-3.05%) ⬇️
modules/git/command.go 86.95% <0.00%> (-2.61%) ⬇️
services/pull/pull.go 34.70% <0.00%> (-1.18%) ⬇️
modules/git/repo_commit.go 53.45% <0.00%> (-0.22%) ⬇️
routers/repo/view.go 36.82% <0.00%> (+0.67%) ⬆️
modules/git/repo.go 48.11% <0.00%> (+0.83%) ⬆️
modules/log/event.go 65.64% <0.00%> (+1.02%) ⬆️
models/unit.go 44.44% <0.00%> (+2.46%) ⬆️
modules/queue/workerpool.go 60.49% <0.00%> (+3.55%) ⬆️
modules/git/utils.go 70.14% <0.00%> (+4.47%) ⬆️
... and 2 more

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 ea67e56...450407f. Read the comment docs.

@mrsdizzie
Copy link
Member

I'd think we should be 'recommending' using the service file since thats our previous recommendation in the same document

sudo systemctl restart gitea

And manually killing as a last resort if not.

@zeripath
Copy link
Contributor

zeripath commented Mar 28, 2020

There also:

> gitea manager help
NAME:
   Gitea manager - Manage the running gitea process

USAGE:
   Gitea manager [global options] command [command options] [arguments...]

VERSION:
   1.12.0+dev-518-gf9f2c163b built with GNU Make 4.2.1, go1.14.1 : sqlite, sqlite_unlock_notify

DESCRIPTION:
   This is a command for managing the running gitea process

COMMANDS:
     shutdown      Gracefully shutdown the running process
     restart       Gracefully restart the running process - (not implemented for windows servers)
     flush-queues  Flush queues in the running process

GLOBAL OPTIONS:
   --custom-path value, -C value  Custom path file path (default: "/home/andrew/src/go/gitea/custom")
   --config value, -c value       Custom configuration file path (default: "/home/andrew/src/go/gitea/custom/conf/app.ini")
   --version, -v                  print the version
   --work-path value, -w value    Set the gitea working path (default: "/home/andrew/src/go/gitea")
   --help, -h                     show help

DEFAULT CONFIGURATION:
     CustomPath:  /home/andrew/src/go/gitea/custom 
     CustomConf:  /home/andrew/src/go/gitea/custom/conf/app.ini
     AppPath:     /home/andrew/src/go/gitea/gitea
     AppWorkPath: /home/andrew/src/go/gitea

@mrsdizzie
Copy link
Member

Either of those seem much better to recommend than killall etc...

I'm not familiar with it but should the systemd unit be trying to use gitea manager to restart/shutdown? Is that better? Or does it otherwise need to be updated for newer graceful features?

@camlafit
Copy link
Contributor Author

Hello

systemd is a solution among other sys init solution.
Then to be more complete/explicit about binary use don't remove other methods information.

And gitea help presume mono instance usage with defaults paths. I don't know if it's adapted when we use custom path.

Maybe we could add a warning about our preferred solution and propose other sys init approach but is not related to this PR.

In my personal use, as I've two instances and I don't understand well systemd, I've written a bash script as far as I understand. I think I'm not alone to launch gitea with a script it's why I propose this addon.

@zeripath
Copy link
Contributor

@mrsdizzie systemd will natively use kill and kill -1 to stop or restart processes as standard. Gitea catches kill -1 and causes a graceful restart. It's actually fine to kill -1 a Gitea process, similarly kill. The only problem is kill -9 which can cause loss of data and corruption.

@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 Mar 31, 2020
Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

systemd

Copy link
Member

@guillep2k guillep2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a side note, this page doesn't even mention Windows. We should change the title to "From binary (Unix-like)" and create a separate Windows page. 😓

Copy link

@zertrin zertrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions for improvement.

* apply @zertrin correction
@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 Apr 28, 2020
@lafriks
Copy link
Member

lafriks commented Apr 30, 2020

make lg-tm work

@lafriks lafriks merged commit d0e7361 into go-gitea:master Apr 30, 2020
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
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. type/docs This PR mainly updates/creates documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants