Erlang start application in production

前端 未结 3 1460
甜味超标
甜味超标 2021-02-06 14:39

When I\'m testing my erlang application on localhost, I have a script that starts the server that looks like the following:

#!/bin/sh
PWD=\"$(pwd)\"
NAME=\"$(bas         


        
3条回答
  •  忘掉有多难
    2021-02-06 15:05

    Add the parameter -detached. The documentation summarizes this nicely:

    Starts the Erlang runtime system detached from the system console. Useful for running daemons and backgrounds processes.

    Once you do that, you can get your application to start with the -s parameter. Assuming $NAME = myapp, init will attempt to call myapp:start/0 (you can customize this if you want). That function should end with a call to application:start(myapp).

    If you can get all of those puzzle pieces in place, you should have a working script.

提交回复
热议问题