onnimonni / docker-unison

Lightweight Docker unison server based on alpine linux for file synchronization
GNU General Public License v3.0
63 stars 27 forks source link

use tini and su-exec to pass signals and run as non-root #19

Closed scytacki closed 6 years ago

scytacki commented 6 years ago

tini is technically optional because you can pass the --init option to docker run but asking people to do everytime they use this image seems annoying

without tini or --init the unison process runs as PID 1, and PID 1 does not have any default signal handlers. So if the process does't install its own handlers the process won't be terminated. It seems unison does not install these handlers.

The bash code with traps and waits does basically the same thing as tini. tini should be a bit more robust than the previous bash code, but I don't have a specific test case where tini is succeeds and the bash code fails.

onnimonni commented 6 years ago

The best thing of open source is that I always learn new stuff. tini and su-exec seem much better suited into this. Thanks a lot!

Do you have anything against it if I add you as a collaborator into this project?

scytacki commented 6 years ago

@onnimonni Adding me as a collaborator is totally fine. Thanks!