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

su instead of su-exec #29

Closed
synergiator opened this issue Nov 10, 2017 · 1 comment
Closed

su instead of su-exec #29

synergiator opened this issue Nov 10, 2017 · 1 comment
Labels

Comments

@synergiator
Copy link

synergiator commented Nov 10, 2017

su-exec is a third-party Alpine package i.e. not a part of GNU neither Apache project:
https://github.com/ncopa/su-exec

Therefore, I thought maybe it can work just with su as well

https://github.com/bigdata-central/zookeeper-docker/blob/ubuntu/3.4.10/docker-entrypoint.sh

(thanks to DevOps SE https://devops.stackexchange.com/questions/2526/interference-of-docker-cmd-with-su-works-with-su-exec-but-not-with-su)

@31z4
Copy link
Owner

31z4 commented Nov 11, 2017

The main motivation for not using su is that it spawns a child process

$ docker run -it --rm zookeeper su -c 'ps aux'
PID   USER     TIME   COMMAND
    1 root       0:00 ash -c ps aux
    8 root       0:00 ps aux

while su-exec does not

$ docker run -it --rm zookeeper su-exec root ps aux
PID   USER     TIME   COMMAND
    1 root       0:00 ps aux

And as it's said in https://github.com/tianon/gosu and https://github.com/ncopa/su-exec this might introduce some TTY and signal-forwarding issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants