LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 08-22-2007, 02:35 PM   #1
jim0112
LQ Newbie
 
Registered: Oct 2006
Location: Brighton, UK
Posts: 18

Rep: Reputation: 0
tftpd-hpa on Ubuntu 6.10 - Error code 1: File not found


Hi,

I use a Linux machine to store Cisco IOS images and configurations. The TFTP service was recently migrated to this box as the old one (which was running Ubuntu 6.06) died.

I can get files OK but for some reason I can't put any files using TFTP. I have tried from LAN PCs as well as localhost.

Package: tftpd-hpa

Service is running:

jim@lx-p4:~$ netstat -ul | grep tftp
udp 0 0 *:tftp *:*

jim@lx-p4:~$ ps aux | grep tftp
root 22553 0.0 0.0 2100 308 ? Ss 19:08 0:00 /usr/sbin/in.tftpd -l -s /tftpboot

Here are the configuation files:

jim@lx-p4:~$ cat /etc/default/tftpd-hpa
#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /tftpboot"

jim@lx-p4:~$ cat /etc/xinetd.d/tftp
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = -l -s /tftpboot
disable = no

This is what happens:

jim@lx-p4:~$ tftp -v localhost
Connected to localhost.localdomain (127.0.0.1), port 69
tftp> get test2.txt
getting from localhost.localdomain:test2.txt to test2.txt [netascii]
tftp>
tftp>quit

jim@lx-p4:~$ ls *.txt
test2.txt

jim@lx-p4:~$ sudo rm /tftpboot/test2.txt

jim@lx-p4:~$ tftp -v localhost
Connected to localhost.localdomain (127.0.0.1), port 69
tftp> put test2.txt
putting test2.txt to localhost.localdomain:test2.txt [netascii]
Error code 1: File not found

This is a different error to the one I get if I try to send a file that doesn't exist:

tftp> put fakefile
tftp: fakefile: No such file or directory

Some Googling revealed the suggestion that I should try to specify the absolute path to the file, but it didn't work and you shouldn't have to do that, I believe.

Any suggestions would be gratefully received - thanks!
 
Old 08-31-2007, 08:08 AM   #2
doublejoon
Member
 
Registered: Oct 2003
Location: King George, VA
Distribution: RHEL/CentOS/Scientific/Fedora, LinuxMint
Posts: 366

Rep: Reputation: 44
Change
Code:
server_args = -l -s /tftpboot
To
Code:
server_args = -c -s /tftpboot
And make sure nobody owns /tftpboot
 
Old 09-11-2007, 04:44 AM   #3
jim0112
LQ Newbie
 
Registered: Oct 2006
Location: Brighton, UK
Posts: 18

Original Poster
Rep: Reputation: 0
Hi,

Thanks for the reply. I've changed to -c:

service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = -c -s /tftpboot
disable = no
}

tftpboot was already owned by nobody, although the group is root - there isn't a nobody group?

drwxrwxrwx 2 nobody root 4096 2007-09-05 14:45 tftpboot

Things have now got a bit weirder. I can now put files, if I'm overwriting a file that is already there. If it isn't, I get the original error!

For example:

root@lx-p4:/# cd /home/jim
root@lx-p4:~# touch testfile2b
root@lx-p4:~# chmod 666 testfile2b
root@lx-p4:~# tftp -v localhost
Connected to localhost.localdomain (127.0.0.1), port 69
tftp> put testfile2b
putting testfile2b to localhost.localdomain:testfile2b [netascii]
Error code 1: File not found
tftp> quit
root@lx-p4:~# cp /home/jim/testfile2b /tftpboot
root@lx-p4:~# tftp -v localhost
Connected to localhost.localdomain (127.0.0.1), port 69
tftp> put testfile2b
putting testfile2b to localhost.localdomain:testfile2b [netascii]
tftp>

root@lx-p4:~# ls -la /tftpboot
total 8
drwxrwxrwx 2 nobody root 4096 2007-09-05 14:45 .
drwxr-xr-x 22 nobody root 4096 2007-09-05 14:42 ..
-rwxrwxrwx 1 nobody root 0 2007-09-05 14:46 testfile2b
 
Old 08-25-2009, 07:19 PM   #4
patcou
LQ Newbie
 
Registered: Aug 2009
Posts: 1

Rep: Reputation: 0
tftpd-hpa problems

FYI - I discovered that in order to PUT a file, I had to change the startup flag from -l to -c (as shown earlier), make sure the directory was read/write, and I had to specify the destination as a fully qualified path:

tftpd -i 192.168.0.1 PUT x.tgz /tftpdump/x.tgz

I hope this helps someone out there !
 
  


Reply

Tags
tftp, ubuntu


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
X problem on Ubuntu 6.10 -- No screens found error Brian5 Ubuntu 3 01-02-2007 05:20 AM
Trouble getting tftpd-hpa working Mithrilhall Linux - Software 1 10-13-2006 04:21 AM
Ubuntu 5.10 preview no screens found error steve.ppunk Linux - Software 2 10-01-2005 11:45 AM
tftpd pxe-01 file not found on terminal fitzy85 Linux - Networking 1 08-11-2004 02:16 AM


All times are GMT -5. The time now is 11:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration