4

I am trying to start tftpd (on arch without inetd) for a simple (or so I thought) operation (nothing permanent).

However, starting tftpd <directory> as advised in the manual fails with this comment in syslog:

tftpd[PID]: recvfrom: Socket operation on non-socket

strace tftpd says:

(...)
geteuid()                               = 0
setgid(65534)                           = 0
setuid(65534)                           = 0
ioctl(0, FIONBIO, [1])                  = 0
recvfrom(0, 0x603600, 516, 0, 0x6035d0, 0x603828) = -1 ENOTSOCK (Socket operation on non-socket)
brk(0)                                  = 0xbe9000
brk(0xc0a000)                           = 0xc0a000
(...)

So, what is going on? No-one is using UDP port 69 yet, and I have temporarily disabled the firewall.

Ned64
  • 8,486
  • 9
  • 48
  • 86
  • `tftpd` run not-under-inet may need a `-l` or `--listen` option, I don't see that in your start command? – thrig Oct 02 '15 at 18:11
  • @thrig Thanks very much. I have the `iputils` variant: http://man7.org/linux/man-pages/man8/tftpd.8.html which apparently does not accept that parameter. (I tried it anyway and it also `exit`s `1`.) – Ned64 Oct 02 '15 at 18:21
  • 1
    Um, from that manual, "The tftpd server should be executed by inetd with dropped root privileges" so it sounds like you need `inetd`, or a flavour of `tftpd` with the `-l` flag otherwise. – thrig Oct 02 '15 at 18:48
  • @thrig Yes, that was the solution, thanks. the `tftpd` that comes with `iputils` just won't run standalone. I tried a different brand and it worked fine. Thanks. (If you make this a solution thrig then I will mark it as such.) – Ned64 Oct 02 '15 at 20:40

1 Answers1

4

tftpd comes in a variety of implementations; some may only be run under an inetd daemon, while others support standalone operation. The Linux iputils tftpd at time of writing only supports operation under an inetd daemon, so must be run that way. Other implementations may have a -l or --listen option to operate as a standalone daemon.

thrig
  • 34,333
  • 3
  • 63
  • 84