erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

Nicer templates #500

Closed benmmurphy closed 7 years ago

benmmurphy commented 8 years ago

We run erlang in production and have noticed that it is quite easy to shoot yourself in the foot when accidentally typing ctrl-c or ctrl-s. Both of these shortcuts are easy to type if you are reaching for ctrl-a, ctrl-d or ctrl-r. ctrl-c by default will run the erlang emulator break handler that will pause the node. This can be destructive on a live system. ctrl-s will cause erlang to block flow control which has some very undesirable effects (see here: http://erlang.org/pipermail/erlang-patches/2010-March/000883.html)

The option to disable the break handler is commented out the vm_args file but you might want to make it the default.

I've also included a change to the script that will set the TERM variable to something sane. For example when deploying from capistrano this will be set to 'dumb' I think which causes problems when you attach to the node. However, it might be better to just hardcode TERM to a particular value. I'm not sure.

tsloughter commented 8 years ago

What is export RUN_ERL_DISABLE_FLOWCNTRL=true?

benmmurphy commented 8 years ago

mkdir /tmp/pipes mkdir /tmp/log run_erl /tmp/pipes /tmp/log erl& to_erl /tmp/pipes

ctrl-s

try and type some stuff (this doesn't work for me on osx. but it does on linux ubuntu)

start crying

ctrl-q

q().

RUN_ERL_DISABLE_FLOWCNTRL=true run_erl /tmp/pipes /tmp/log erl& to_erl /tmp/pipes

ctrl-s

start typing.

don't cry

more information here: http://erlang.org/pipermail/erlang-patches/2010-March/000883.html

tsloughter commented 8 years ago

Ok, I'm fine with it being a new default but we should still allow it to be overridden. So something like:

RUN_ERL_DISABLE_FLOWCNTRL=${RUN_ERL_DISABLE_FLOWCNTRL:-true}
export $RUN_ERL_DISABLE_FLOWCNTRL
ferd commented 8 years ago

Is this only for when you're using pipes? Pressing ctrl-c shouldn't stall a production node if you're using a remote shell to access it, it will interrupt the local handler only, not the one on the prod node.

bitwalker commented 8 years ago

I think is meant to handle CTRL+S not CTRL+C, but yes I think this only meant for attaching to a pipe, not remote console.

lrascao commented 8 years ago

I think this makes sense since some times you need to attach to the node (to view console output for example), this reduces the probability of accidentally killing a node +1 (if @tsloughter remark is implemented) ping @benmmurphy

lrascao commented 7 years ago

closing since #528 has been merged