<div dir="ltr">Hello All,<div><br></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">Currently, one can start an Erlang node in distributed mode by passing in the “proto_dist” parameter on the command line. Could anyone please let me know if there is a way to start the distribution on a non-distributed Erlang node (in any one of inet_tcp/inet6_tcp/inet_tls/inet6_tls modes) programmatically?</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69);min-height:14px"><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">In the code (<a href="https://github.com/erlang/otp/blob/master/lib/kernel/src/net_kernel.erl#L1487"><span class="gmail-s1" style="color:rgb(228,175,10)">https://github.com/erlang/otp/blob/master/lib/kernel/src/net_kernel.erl#L1487</span></a>), there seems to be a reliance on the presence of the command line argument “proto_dist”. If not passed, proto_dist always defaults to inet_tcp.</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69);min-height:14px"><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">If there is a way to start the distribution programmatically, then the logic that decides what proto_dist value to pass can be moved from the init script (when the application is run as a service) into an Erlang module. This would also help in not having to re-write this code snippet for all the different platforms (Linux/Windows/OSX) that one would want to support.</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69);min-height:14px"><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">Any tips on this will be very helpful.</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)"><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">But if there is no support to start the distribution programmatically, then would it make sense to add that support?</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)"><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">Best regards,</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;font-family:"Helvetica Neue";color:rgb(69,69,69)">Ajit</p></div></div>