1

I am using inetutils tftpd which is started via inetd using the following entry in inetd.conf:

tftp       dgram   udp     wait    root   /bin/tftpd -p -u root -s /home

(ignore the use of root account and /home directory, it's just for testing purposes, it will be changed later).

inetd version is inetd (GNU inetutils) 1.7

tftpd version is tftp-hpa 5.2, with remap, with tcpwrappers

Everything works fine, but the problem is that I don't have any information about the file transfer status. Having in mind that I have more than 10 scripts that rely on tftpd, I need to either:

  • terminate tftpd after the file transfer or error (because it keeps running in the background doing nothing)

  • make it display file transfer status in a way that I can grep sed or at least $?

Is this possible, and if not, what other tftpd server should I use?

Ulrik
  • 1,131
  • 4
  • 19
  • 37
  • Hello Ulrik. Unless you intend to write your own TFTP server, this question is probably more suited for serverfault.com or superuser.com - "Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming". – Paulo Scardine Nov 27 '14 at 20:30
  • Yes, I was thinking about that, but I am using `TFTP` as integral part of my scripting engine, so I thought I could get some useful input from this community... – Ulrik Nov 28 '14 at 00:27
  • TFTP is as dumb as a protocol can be, and tftpd is scary from the security point of view. Take a look at https://wiki.python.org/moin/tftp – Paulo Scardine Nov 28 '14 at 01:03

1 Answers1

1

From the man page for tftpd:

--timeout timeout, -t timeout

When run from inetd this specifies how long, in seconds, to wait for a second connection before terminating the server. inetd will then respawn the server when another request comes in. The default is 900 (15 minutes.)

Try changing your inetd.conf like so:

tftp       dgram   udp     wait    root   /bin/tftpd -t 5 -p -u root -s /home

Then restart inetd and test.

Jesse Parker
  • 156
  • 5
  • Your answer was the key - I wrote a `bash` script that looks for `tftpd` in the process list and reports the status. btw, `GNU tftpd` is picky about the order of given arguments, they need to be specified in the order listed in the man page... – Ulrik Dec 02 '14 at 09:41