mirror of https://github.com/zulip/zulip.git
2a59b2d2ac
Before this fix, the installer has an extremely annoying bug where when run inside a container with `lxc-attach`, when the installer finishes, the `lxc-attach` just hangs and doesn't respond even to C-c or C-z. The only way to get the terminal back is to root around from some other terminal to find the PID and kill it; then run something like `stty sane` to fix the messed-up terminal settings left behind. After bisecting pieces of the install script to locate which step was causing the issue, it comes down to the `service camo restart`. The comment here indicates that we knew about an annoying bug here years ago, and just swept it under the rug by skipping this step when in Travis. >_< The issue can be reproduced by running simply `service camo restart` under `lxc-attach` instead of the installer; or `service camo start`, following a `service camo stop`. If `lxc-attach` is used to get an interactive shell, these commands appear to work fine; but then when that shell exits, the same hang appears. So, when we start camo we're evidently leaving some kind of mess that entangles the daemon with our shell. Looking at the camo initscript where it starts the daemon, there's not much code, and one flag jumps out as suspicious: start-stop-daemon --start --quiet --pidfile $PIDFILE -bm \ --exec $DAEMON --no-close -c nobody --test > /dev/null 2>&1 \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE -bm \ --no-close -c nobody --exec $DAEMON -- \ $DAEMON_ARGS >> /var/log/camo/camo.log 2>&1 \ || return 2 What does `--no-close` do? -C, --no-close Do not close any file descriptor when forcing the daemon into the background (since version 1.16.5). Used for debugging purposes to see the process output, or to redirect file descriptors to log the process output. And in fact, looking in /proc/PID/fd while a hang is happening finds that fd 0 on the camo daemon process, aka stdin, is connected to our terminal. So, stop that by denying the initscript our stdin in the first place. This fixes the problem. The Debian maintainer turns out to be "Zulip Debian Packaging Team", at debian@zulip.com; so this package and its bugs are basically ours. |
||
---|---|---|
.. | ||
third | ||
__init__.py | ||
cd_exec | ||
certbot-maybe-renew | ||
check-upstart | ||
clean-emoji-cache | ||
clean-npm-cache | ||
clean-unused-caches | ||
clean-venv-cache | ||
create-production-venv | ||
create-thumbor-venv | ||
create-zulip-admin | ||
docker-functions.sh | ||
email-mirror-postfix | ||
hash_reqs.py | ||
install | ||
install-node | ||
node_cache.py | ||
pythonrc.py | ||
queue_workers.py | ||
setup-apt-repo | ||
setup_path_on_import.py | ||
setup_venv.py | ||
unpack-zulip | ||
upgrade-zulip | ||
upgrade-zulip-stage-2 | ||
zulip_tools.py |