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

docker: ask s6 to stop all service when gitea stop #9171

Merged
merged 3 commits into from Nov 27, 2019

Conversation

@sapk
Copy link
Member

sapk commented Nov 27, 2019

This should fix #9164 part of the container not stopping when gitea fail.

Follow : https://github.com/just-containers/s6-overlay#writing-an-optional-finish-script

Still WIP since I need to test it.

@sapk sapk added this to the 1.11.0 milestone Nov 27, 2019
@sapk sapk changed the title [WIP] fix: ask s6 to stop all service when gitea stop [WIP] docker: ask s6 to stop all service when gitea stop Nov 27, 2019
@sapk sapk added the status/wip label Nov 27, 2019
@sapk

This comment has been minimized.

Copy link
Member Author

sapk commented Nov 27, 2019

Tested (and fixed) !

Before :

$ docker run -v "$(pwd)/data:/data:ro" --rm -ti gitea/gitea
....
2019/11/27 01:19:20 ...s/setting/setting.go:670:NewContext() [F] Failed to create '/data/git/.ssh': mkdir /data/git: read-only file system
mkdir: can't create directory '/data/ssh': Read-only file system
...
2019/11/27 01:19:22 ...s/setting/setting.go:670:NewContext() [F] Failed to create '/data/git/.ssh': mkdir /data/git: read-only file system
mkdir: can't create directory '/data/ssh': Read-only file system
...
2019/11/27 01:19:22 ...s/setting/setting.go:670:NewContext() [F] Failed to create '/data/git/.ssh': mkdir /data/git: read-only file system
...

After :

$ docker run -v "$(pwd)/data:/data:ro" --rm -ti sapk/gitea
...
2019/11/27 01:46:27 cmd/web.go:102:runWeb() [I] Starting Gitea on PID: 16
2019/11/27 01:46:27 ...s/setting/setting.go:523:NewContext() [W] Custom config '/data/gitea/conf/app.ini' not found, ignore this if you're running first time
2019/11/27 01:46:27 ...s/setting/setting.go:670:NewContext() [F] Failed to create '/data/git/.ssh': mkdir /data/git: read-only file system
Saving key "/data/ssh/ssh_host_rsa_key" failed: No such file or directory
Generating /data/ssh/ssh_host_dsa_key...

All services are stopped quickly after first fail and the container is stopped.

@sapk sapk removed the status/wip label Nov 27, 2019
@sapk sapk changed the title [WIP] docker: ask s6 to stop all service when gitea stop docker: ask s6 to stop all service when gitea stop Nov 27, 2019
@GiteaBot GiteaBot added lgtm/need 1 and removed lgtm/need 2 labels Nov 27, 2019
@GiteaBot GiteaBot added lgtm/done and removed lgtm/need 1 labels Nov 27, 2019
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Nov 27, 2019

Codecov Report

Merging #9171 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9171      +/-   ##
==========================================
+ Coverage   41.03%   41.03%   +<.01%     
==========================================
  Files         553      553              
  Lines       72041    72041              
==========================================
+ Hits        29564    29565       +1     
- Misses      38744    38746       +2     
+ Partials     3733     3730       -3
Impacted Files Coverage Δ
modules/indexer/indexer.go 44.73% <0%> (-10.53%) ⬇️
modules/log/event.go 65.64% <0%> (+1.02%) ⬆️
modules/process/manager.go 78.37% <0%> (+4.05%) ⬆️

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 9591185...e7d50df. Read the comment docs.

@techknowlogick techknowlogick merged commit 6e578dd into go-gitea:master Nov 27, 2019
2 checks passed
2 checks passed
approvals/lgtm this commit looks good
continuous-integration/drone/pr Build is passing
Details
@sapk sapk deleted the sapk-fork:force-docker-kill branch Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants
You can’t perform that action at this time.