[erlang-questions] inets / tftpd startup question

Hakan Mattsson <>
Tue Oct 3 11:46:22 CEST 2006


On Sun, 1 Oct 2006, Pete Kazmier wrote:

PK> As I mentioned in my previous email, I've started using the tftpd
PK> server included in inets.  However, I'm having a hard time figuring
PK> out the best way to start it.  I was hoping that this would work:
PK> 
PK> $ erl -sname tftp -detached -eval 'tftp:start([{port,8069}]).' 

The TFTP daemon is linked to its parent process and
will terminate when its parent dies. In this case
the parent does not survive the startup.

As the TFTP code is a part of the inets application, it
is complient with its (rather static) service concept.
In order to start the TFTP daemon as an inets service,
you can either put the following in a config file
(in this case tftp.config):

  [
    {inets, [{services, [{tftpd, [{port, 8069}]}]}]}
  ].

and start the TFTP daemon with:

  erl -sname tftp -config tftp.config -s tftp

or do it as a one-liner:

  erl -sname tftp -detached -inets services '[{tftpd, [{port, 8069}]}]' -s tftp

The trailing '-s tftp' is just a convenient way of
invoking application:start(inets).

/Håkan


More information about the erlang-questions mailing list