colinmollenhour / mariadb-galera-swarm

MariaDb Galera Cluster container based on official mariadb image which can auto-bootstrap and recover cluster state.
https://hub.docker.com/r/colinmollenhour/mariadb-galera-swarm
Apache License 2.0
217 stars 102 forks source link

avoid socat TTY handling #63

Closed lexelby closed 5 years ago

lexelby commented 5 years ago

This change makes it so that everything works properly even if the user ran with docker -ti.

socat detects whether stdout is a TTY and "helpfully" stores and restores TTY settings with tcgetattr() and tcsetattr(). Upon the call to tcsetattr(), socat receives signal 22, SIGTTOU. Docker (or some other parent process) seems to set the signal disposition for SIGTTOU to "terminate", and thus socat exits with status 150 (128 + 22). This causes SENT_NODES not to be updated. All that because the user thought they might want to run with docker -ti to watch the output while the cluster booted up.

Of course, the answer could be "don't run with --tty", but we don't actually need socat's stdout and this change prevents the user from shooting their foot.

colinmollenhour commented 5 years ago

Thanks for the patch and thorough explanation!