Linux – TFTP: Server Error: (2) Access Violation

linuxtftpxinetd

I am trying to send a file to TFTP server using below command:

tftp -p -l test.txt xx.xx.xx.xx

And TFTP usage is:

BusyBox v1.13.2 (2011-03-24 18:58:44 CDT) multi-call binary

Usage: tftp [OPTION]… HOST [PORT]

Transfer a file from/to tftp server

Options: -l FILE Local FILE -r FILE Remote FILE -g Get file -p Put file

When I tried to send a file with the above command, I got this error: tftp: server error: (2) Access violation....

But if I create test.txt (file name that I needed to send) in the server manually and then try to transfer to server, it uploaded successfully.

How can I send the file without manual creation?

I am using xinetd service for tftp server, and below is its config file.

/etc/xinetd.d/tftp : service tftp { protocol = udp port = 69 socket_type = dgram wait = yes user = root server = /usr/sbin/in.tftpd server_args = /tftpboot/ disable = no }

Best Answer

So this is how I debugged the issue.

# tail /var/log/syslog

The output of the above command said tftpd was serving files from /srv/tftp but there is no mention of /srv/tftp in /etc/xinetd.d/tftp.

Also this post helped to debug the issue: http://toddharris.net/blog/2011/06/19/debugging-xinetd-at-system-launch/. Running xinetd in debug mode did not cause this problem.

The culprit was the tftp line in /etc/inetd.conf as mentioned in the following link: http://www.beer.org/blog/category/tech-stuff.html Most probably when xinetd runs as a daemon, the /etc/inetd.conf takes precedence over the config files in /etc/xinetd.d directory and that is why this issue occurs when xinetd runs as a daemon.

Comment out the tftp line in /etc/inetd.conf and restart xinetd and that fixed this issue.

Related Question