DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 30th October 2015
mikygee mikygee is offline
Port Guard
 
Join Date: Oct 2011
Posts: 15
Default Can't make tftpd work with inetd

Hello,

I'm unable to make tftpd work with inetd, I've tried very hard and decided to ask here.
My OpenBSD system is not the newest one: 5.3

When I run tftpd by hand it works fine
PHP Code:
# /usr/sbin/tftpd -4 -v -c /tftpboot 
The problem comes when I expect inetd to start tftpd
PHP Code:
# grep tftpd /etc/inetd.conf
tftp    dgram   udp   wait    root    /usr/sbin/tftpd     tftpd ---/tftpboot 
I read the man pages and it said that:
- The service name has to exist in /etc/services, so that an udp packet received on port 69 should trigger inetd to start tftpd
PHP Code:
# grep tftp /etc/services
tftp            69/udp 
- udp has to be definied in /etc/protocols
PHP Code:
# grep udp /etc/protocols
udp     17      UDP             # user datagram protocol 
My inetd is started
PHP Code:
# ps alx | grep inetd
0 14039     1   0   2   0   324   908 select  Is    ??    0:00.09 inetd 
And I kill -HUP the PID everytime I modify the inetd.conf

=> I tcpdump on port 69 and see 5 attempts
The inetd never start tftpd and the tftp client times out after a certain time.
When I did the tests I disabled pf: pfctl -d

The logs tell me something is wrong
PHP Code:
# tail /var/log/messages
Oct 30 23:54:13 x inetd[14039]: /usr/sbin/tftpd: exit status 1
Oct 30 23
:54:14 x last message repeated 253 times
Oct 30 23
:54:14 x inetd[14039]: tftp/udp server failing (looping), service terminated 
Do you have an idea about what's wrong there ?
Reply With Quote
  #2   (View Single Post)  
Old 31st October 2015
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

In your /etc/inetd.conf, it looks like the appearance of "tftpd" as an argument to the program is a boo-boo. This probably causes the program to fail as soon as it's run by inetd.
Reply With Quote
  #3   (View Single Post)  
Old 31st October 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

It is possible that running inetd with the "-d" option will produce messages which might offer insights, improving problem source identification.
Reply With Quote
  #4   (View Single Post)  
Old 31st October 2015
mikygee mikygee is offline
Port Guard
 
Join Date: Oct 2011
Posts: 15
Default

Hello I did not understand what you meant by boo-boo.

I tried to delete the second occurence of tftpd in my inetd.conf
PHP Code:
tftp      dgram   udp     wait    root    /usr/sbin/tftpd     ---/home/tftpboot 
Then when I run inetd-d I have this output repeated numerous times
PHP Code:
19946 execv /usr/sbin/tftpd
reaping asked 
for
19946 reapedstatus 100
restored tftp
fd 4
someone wants tftp 
But form the client's side it times out

And a wrong command line seems to be started by inetd
PHP Code:
# ps alx | grep tftp
79 16987     1   0   2   0   360   584 kqread  Is    ??    0:00.00 ---/home/tftpboot (tftpd

With my original configuration
PHP Code:
tftp      dgram   udp     wait    root    /usr/sbin/tftpd     tftpd ---/home/tftpboot 
I have a similar output when I start inetd with the -d option

Thank you
Reply With Quote
  #5   (View Single Post)  
Old 31st October 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I'll try to recreate the problem.
Reply With Quote
  #6   (View Single Post)  
Old 31st October 2015
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Quote:
Originally Posted by mikygee View Post
Hello I did not understand what you meant by boo-boo.
Sorry for the confusion, it's just a way of saying a little mistake.
Reply With Quote
  #7   (View Single Post)  
Old 31st October 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I'm able to recreate the problem on 5.8-stable.[1] So I thought I'd do a little research. At one time, tftpd did not support standalone operation, it required inetd for socket management.

http://marc.info/?t=121788368600008&r=1&w=2

Then, in 2012, the tftpd program was rewritten. It became a standalone program, with support for IPv6, and included a newly rewritten tftp-proxy as an adjunct.

It is no longer intended to be used with inetd.

http://cvsweb.openbsd.org/cgi-bin/cv...tftpd/Makefile
http://www.openbsd.org/plus52.html

----

[1] Saving stderr from inetd -d shows a consistent loop:
Code:
someone wants tftp
18766 execv /usr/sbin/tftpd
reaping asked for
18766 reaped, status 100
restored tftp, fd 9
someone wants tftp
12715 execv /usr/sbin/tftpd
reaping asked for
12715 reaped, status 100
restored tftp, fd 9
someone wants tftp
5625 execv /usr/sbin/tftpd

Last edited by jggimi; 31st October 2015 at 08:07 PM. Reason: clarity, typo
Reply With Quote
  #8   (View Single Post)  
Old 1st November 2015
mikygee mikygee is offline
Port Guard
 
Join Date: Oct 2011
Posts: 15
Default

Thank you very much all for your help.

Now I understand why, I was able to use tftpd with inetd and one day it didn't work anymore. On my system I still use 5.3 and plan to upgrade to 5.8 but I have to check everything I run is compatible before doing that (httpd).

Have a nice week end
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Comment out '/etc/inetd.conf' and disable 'inetd' daemon J65nko Guides 0 24th January 2010 10:53 PM
NetBSD on a laptop: trying to make it work Mr-Biscuit NetBSD Installation and Upgrading 1 1st June 2009 01:43 AM
Any chance to make work in FreeBSD ? giga FreeBSD General 2 30th January 2009 10:07 PM
firefox3 with mplayer-plugin? Any possibility to make them work together.? daemonFromHeaven FreeBSD Ports and Packages 4 16th September 2008 09:47 AM
How to make it work with VLAN-trunking? Seb74 OpenBSD Security 4 28th June 2008 02:08 PM


All times are GMT. The time now is 01:46 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick