# tftp-hpa xinetd problem

## redwood

I have a server which serves ltsp kernels via tftp-hpa.

After an accidental upgrade to baselayout-2.0, I decided to 

re-emerge every package which installed into /etc/init.d/

e.g. 

for f in $(equery belongs /etc/init.d/* |cut -d ' ' -f 2 ); do emerge =$f; done

Unfortunately this broke tftp.

I eventually disabled xinetd support for tftp

and started the service manually through '/etc/init.d/in.tftp start'

which did work, and my thin clients were able to boot.

However, I don't know what's wrong with my /etc/xinetd.d/tftp configuration:

service tftp

{

        disable = no

        socket_type = dgram

        protocol = udp

        port = 69

        wait = yes

        user = root

        server = /usr/sbin/in.tftpd

        server_args     = -p -u nobody -R 4096:32767 -vvv -s /tftpboot

        log_on_success  += DURATION PID HOST EXIT

        log_on_failure  += HOST

        only_from       = localhost 127.0.0.1 192.168.1.0/24

}

When I manually connect to my tftp server and try to download a binary kernel image, tftp times out:

tftp> verbose

Verbose mode on.

tftp> mode image

mode set to octet

tftp> get /lts/vmlinuz-2.6.17.8-ltsp-1

getting from pbx:/lts/vmlinuz-2.6.17.8-ltsp-1 to vmlinuz-2.6.17.8-ltsp-1 [octet]

Transfer timed out.

This is my /etc/conf.d/in.tftp which DOES work when starting the service manually:

# cat /etc/conf.d/in.tftpd |grep -v '^#' | grep -v '^$'

INTFTPD_PATH="/tftpboot"

INTFTPD_OPTS="-p -u nobody -R 4096:32767 -vvvvvv  -s ${INTFTPD_PATH}"

THANKS in advance for any ideas on what might be wrong.

----------

## erik258

Are you sure xinetd is running?

----------

## redwood

OK, I checked:

pbx xinetd.d # /etc/init.d/xinetd status

 * status: started

pbx xinetd.d # ps -ef|grep xinetc

root      5675 18270  0 16:07 pts/2    00:00:00 grep --colour=auto xinetc

And so it's not actually running!

So I tried restarting: 

pbx xinetd.d # /etc/init.d/xinetd stop

 * Stopping xinetd ...                                                                                                            [ ok ]

pbx xinetd.d # ps -ef|grep xinetd

root      5693 18270  0 16:08 pts/2    00:00:00 grep --colour=auto xinetd

pbx xinetd.d # /etc/init.d/xinetd start

 * Starting xinetd ...                                                                                                            [ ok ]

pbx xinetd.d # ps -ef|grep xinetd

root      5708     1  0 16:08 ?        00:00:00 /usr/sbin/xinetd -pidfile /var/run/xinetd.pid -stayalive -reuse

root      5711 18270  0 16:09 pts/2    00:00:00 grep --colour=auto xinetd

And now it works:

axp ~ # tftp pbx

tftp> verbose

Verbose mode on.

tftp> mode binary

mode set to octet

tftp> get /lts/vmlinuz-2.6.17.8-ltsp-1

getting from pbx:/lts/vmlinuz-2.6.17.8-ltsp-1 to vmlinuz-2.6.17.8-ltsp-1 [octet]

Received 2878976 bytes in 0.5 seconds [46380861 bit/s]

tftp> quit

axp ~ # ls vmlinuz-2.6.17.8-ltsp-1

vmlinuz-2.6.17.8-ltsp-1

Thanks a lot!!!

----------

