protonmail-bridge-docker icon indicating copy to clipboard operation
protonmail-bridge-docker copied to clipboard

Pkill causes container to exit

Open jcrsilva opened this issue 2 years ago • 0 comments

The entrypoint script had the following line added in commit 680e82076e9313c94330bcccac745db07468854c:

pkill protonmail-bridge

I don't know why this is even here since in normal conditions you won't be able to have two bridge instances. When running in kubernetes the correct way to do the init process would be with an init container before the main one starts up.

This being said when another process does not exist this command will exit with rc 1:

Exit Status The following exit values are returned: 0 One or more processes were matched. 1 No processes were matched. 2 Invalid command line options were specified. 3 A fatal error occurred.

Since at the top of the script we're doing:

set -ex

This will cause the container to exit immediately if another instance of the bridge does not exist.

IMO the whole pkill line should be removed since at first glance it looks like an antipattern, however if it is decided to keep it it should be modified to always return 0:

pkill protonmail-bridge || true

jcrsilva avatar Aug 28 '22 21:08 jcrsilva