Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 594880 - xinetd daemon failed to start TFTP server
xinetd daemon failed to start TFTP server
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: tftp (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Jiri Skala
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-21 16:24 EDT by andya
Modified: 2014-11-09 17:33 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-28 04:55:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description andya 2010-05-21 16:24:48 EDT
Description of problem:
TFTP server does not start under xinetd daemon
(or xinetd daemon failed to start TFTP server)

Version-Release number of selected component (if applicable):
Fedora release 12
Kernel Linux: 2.6.31.5-127.fc12.i386
GNOME: 2.28.0

Hardware:
PC with Intel P4 and 512MB RAM


How reproducible:
Very easy

Steps to Reproduce:
1. install tftp server
yum install tftp-server -y

2. modify /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#	protocol.  The tftp protocol is often used to boot diskless \
#	workstations, download configuration files to network-aware printers, \
#	and to start the installation process for some operating systems.
service tftp
{
	disable	= no
	socket_type		= dgram
	protocol		= udp
	wait			= no
	user			= root
	server			= /usr/sbin/in.tftpd -l
	server_args		= -s /tftpboot
	per_source		= 11
	cps			= 100 2
	flags			= IPv4
}

3. Turn on tftp under xinetd daemon
chkconfig tftp on
chkconfig xinetd on

4. Start xinetd service
/usr/sbin/service xinetd restart

5. Disable firewall

6. verify tftp service
lsof -i | grep ftp

Actual results:
Note: No tftp results

Expected results:
tftp results


Additional info:

After working on it for day, I finally figure out to manually start tftp daemon
/usr/sbin/in.tftpd -l &

Then on my tftp PC client, I have to specify full path name
tftp 192.168.54.242 (fedora tftp server) /tftpboot/readme.txt readme.txt

To tftp the file.
Comment 1 Jiri Skala 2010-05-24 08:16:15 EDT
Hi,
I see there a couple of issues in configuration:

- I don't think option -l should be used in combination with xinetd
- there is server_args line for options in the tftp config of xinetd (-l 1 line down)
- -s option ensures asking for full path
- if you start tftp via xinetd tftpd will not be started immediately. The daemon is started when client tries to connect.Try following:

1. configure tftp fro xinetd
2. restart xinetd
3. try something like ps -ef | grep ftp ... no tftpd process
4. use client tftp <ip_addr>
5. when client is connected try ps -ef | grep ftp ... should find a process

Let me know about results.

Thanks Jiri
Comment 2 andya 2010-05-24 10:07:01 EDT
Jiri,
Thanks for the feedback.
1. tftp fix
I deleted the -l from the tftp which will place the tftp under xinetd control.
I deleted the -s from the tftp too.
so the current tftp is as follows:
...
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        disable = no
        socket_type             = dgram
        protocol                = udp
        wait                    = no
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = /tftpboot
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
"/etc/xinetd.d/tftp" 18L, 503C

...

2. restart xinetd service
[root@dhcp-22-164 andyan]# service xinetd stop
Stopping xinetd:                                           [  OK  ]
[root@dhcp-22-164 andyan]# service xinetd start
Starting xinetd:                                           [  OK  ]
[root@dhcp-22-164 andyan]# ps -ef | grep tftp
root      1980     1  0 09:43 ?        00:00:00 in.tftpd -s /tftpboot
root      2146  2129  0 10:01 ?        00:00:00 in.tftpd /tftpboot
root      2152  2098  0 10:01 pts/1    00:00:00 grep tftp
[root@dhcp-22-164 andyan]# 

3. tftp server directory
[root@dhcp-22-164 andyan]# ls /tftpboot -l
total 16
-rw-rw-rw-. 1 nobody nobody  34 2010-05-21 14:10 readme.txt
-rw-r--r--. 1 root   root     0 2010-05-21 08:06 test.txt
-rw-r--r--. 1 root   root   509 2010-05-21 16:16 tftp
-rw-r--r--. 1 root   root    25 2010-05-21 12:46 touch.txt
-rw-r--r--. 1 root   root    18 2010-05-21 07:42 win.txt
[root@dhcp-22-164 andyan]# 

4. on my XP client,
tftp 192.168.54.242 (fedora IP) readme.txt readme.txt
error on server: only absolute filename allowed.

tftp 192.168.54.242 (fedora IP) /tftpboot/readme.txt readme.txt
error on server: permission denied.

the tftp service is under xinetd control now, but what is wrong with my tftp file?

Why and how to fix it?

Please help me your help is greatly appreciated as I spent weekend on it and I am new to linux.


Andy A.
Comment 3 Jiri Skala 2010-05-27 04:10:34 EDT
I suppose the 'permission denied' message is due to selinux. If you watch Selinux Troubleshooter you should find a message there. There is also how to allow access - use chcon to set acceptable selinux context.

You can also switch selinux from enforce mode to permisive. Then you obtain selinux message but selinux will not block the operation.

This on your decision.
Comment 4 Jiri Skala 2010-05-28 04:55:06 EDT
After tests I suppose this issue was introduced insufficient configuration so I'm going to close it notabug.
Comment 5 andya 2010-05-29 08:28:01 EDT
Jiri,
I got the tftp service working. I had already disabled selinux before your last post as I did notice the selinux warning. 
The issue is the right of the /tftpboot directory. The directory itself must have "rwx" privilege for tftp service to work and this bugged me for several days before I finally figured it out after reading two books and googling it.
Thanks for the help.

But the xinetd daemon does not stop tftp service.

I stopped the xinetd service, but the tftp service is till working.

chkconfig tftp on
chkconfig --list
chkconfig xinetd on
service xinetd restart
ps -ef | grep tftp
or
netsat -a | grep tftp
// tfftp service is working

service xinetd stop
ps -ef | grep tftp
// tftp service is still working.


This is a bug to me.


Andy An
Comment 6 Jiri Skala 2010-06-01 04:45:25 EDT
tftpd (in.tftpd) daemon uses timeout parameter -t <seconds> (900 seconds by default) - see man tftpd.

If there is no new connection during this time in.tftpd is terminated - not depends on xinetd status (running/stpped).

Note You need to log in before you can comment on or make changes to this bug.