cryolite.iteye.com/blog/383927

The Erlang runtime comes with a terminal by default, which makes it easy to check for bugs during development, but after development, the service should be run in the background.

-noshell (This parameter closes the terminal but does not run in the background. Output is directly printed to the current screen

-noinput Disables terminal input

-hidden Hidden running

-detached Runs in background mode

The best thing to use is -detached. If you add this parameter to your startup script, the program will run immediately in the background. You can use the process id to call it into the foreground. You’ll see that this parameter is automatically split into -noshell and -noinput, so with -detached, you don’t need to add these two parameters

——-

Start an Erlang virtual machine just like a normal Java application, and the program runs on the virtual machine without an interactive interface. One way to do this is to start with the -detached parameter, so the Erlang virtual machine goes into what’s called detached mode. In detached mode, Erlang runs quietly in the background, without the usual interactive terminal interface. Example: Start a my_app in detached mode \

Shell code

  1. Erl-detached -name [email protected] -setcookie ABC -s my_app

The my_app runs in the background just like a normal daemon application but what to do when you want to control the Detached Erlang virtual machine, such as quitting the application or checking the state of the Erlang application. As far as I know, there are two ways to connect the Detached mode Erlang node: 1. Remote shell JCL login, described in Programming Erlang section 6.7.3, is simply the Shell interface after CTRL + G. I) start an Erlang node: \

Shell code

  1. Erl-name [email protected] -setcookie ABC

Ii) CTRL + G into shell JCL, then connect remotely to the Detached mode of Erlang: \

Erlang shell code

  1. –> r ‘[email protected]’  
  2. –> c  
  3. Eshell V5.7.1  (abort with ^G)  
  4. 1 > ([email protected])

You can control the Detached mode of Erlang 2. Use the -remsh argument \ of erL

Shell code

  1. Erl-name [email protected] -remsh [email protected] -setcookie ABC

Detached shell JCL is better. If you have multiple detached Erlang nodes (whether remote or not), you can control them with a single Erlang shell. A little screen feeling, hehe. Detached mode is a good fit for the usual Erlang startup method. In mryufeng another practical access to the Erlang console method mentioned in the method is also quite good to say, but do not know whether remote access. Well, take a note: a startup with the -detached parameter might be equivalent to a startup with both the -noshell and -noinput arguments, using \

Linux shell code

  1. ps -ef|grep beam  

Detached If you look at the -detached started Erlang process, you’ll find that it contains the -noshell -noinput parameters. Detached Mode 2. Erl 3. How to start an Erlang application from the command line non-interactively? \