ahdinosaur / ssb-pub

easily host your own Secure ScuttleButt (SSB) pub in a docker container
http://butt.nz/
GNU Affero General Public License v3.0
158 stars 25 forks source link

Use tini as pid1 in the docker image #18

Closed geigerzaehler closed 5 years ago

geigerzaehler commented 5 years ago

Because sbot server does not install signal handlers and is run as PID 1 the SIGINT and SIGTERM signals do not terminate the process. This means for example that docker stop takes a long time since it waits for SIGTERM to have an effect and then sends SIGKILL. tini solves this problem.

ahdinosaur commented 5 years ago

hi @geigerzaehler, this is a great idea, i apologize for not doing this already!

since tini is now included in Docker itself since version 1.13, rather than intalling tini in the image, is it possible to instead update the installation scripts and documentation to pass the --init flag to docker run?

geigerzaehler commented 5 years ago

is it possible to instead update the installation scripts and documentation to pass the --init flag to docker run?

Yes, the --init flag works nicely when using plain docker. But we are using Kubernetes to deploy the image and it does not allow you to specify this flag. Right now we have to tell Kubernetes to forcibly kill the container and this PR would fix that.

ahdinosaur commented 5 years ago

okay, makes sense, merged! :tada:

by the way, i'm curious, who's the "we" with whom you're running SSB pubs? :shell:

geigerzaehler commented 5 years ago

Thanks for merging!

By “we” I mean the team working on oscoin and radicle. We are using ssb for public communication and are running our own pub (%WUIfprUKTN/mrBP+Ved/X+zszVA1nRMmnzVIrr8ySD8=.sha256)

ahdinosaur commented 5 years ago

by the way, published as 1.0.6, docker build tagged as v1.0.6