tftpd-hpa does not use /etc/default/tftp-hpa options

Bug #227881 reported by syrex151 on 2008-05-07
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu Server papercuts
tftp-hpa (Ubuntu)

Bug Description

Binary package hint: tftpd-hpa

The options that should be passed to in.tftpd when being run as a daemon are not used. Instead in.tftpd uses the options in the /etc/inetd.conf file.

For example if I set in /etc/default/tftp-hpa:
#Defaults for tftpd-hpa
OPTIONS="-l -s /tftpboot"

and use the command

# sudo /etc/init.d/tftpd-hpa restart

tftp uses /var/lib/tftpboot and not /tftpboot as I want. To fix this I commented out the offending line in /etc/inetd.conf which was running tftp as an inet process and everything works as it should. If a person wants to run tftpd-hpa as a daemon and not an inet process then this step needs to be documented, possibly in /etc/default/tftp-hpa. Changing /etc/default/tftp-hpa to:

#Defaults for tftpd-hpa
# If running tftpd-hpa as a daemon change RUN_DAEMON to yes
# and comment out tftpd line in /etc/inetd.conf file.
OPTIONS="-l -s /tftpboot"

Or alternatively the line in /etc/inetd.conf should be commented out as default and running tftpd-hpa as a daemon should be the default behavior. As this is only a recent problem with Hardy there can be some confusion when doing an upgrade about why tftp is not using the right directory, better documentation of recent changes should be made.

Loye Young (loyeyoung) wrote :

Confirmed. The solution suggested here would fix bug 181017.

Happy Trails,

Loye Young
Isaac & Young Computer Company
Laredo, Texas

Changed in tftp-hpa:
status: New → Confirmed
Nick Moffitt (nick-moffitt) wrote :

One further problem with the tftpd-hpa package is that it depends on inet-superserver despite being able to run perfectly well without one. I discovered with some surprise that openbsd-inetd had been dragged in somehow, and attempts to purge it would remove tftpd-hpa.

The relationship between tftpd-hpa and inet-superservers really needs to be re-thought. I wish to run it as a standalone daemon, and I do not want inetd on my systems.

Furthermore, the feedback from /etc/init.d/tftpd-hpa left no clue that it had failed to bind to UDP port 69 (thanks to inetd claiming it) beyond lack of a newline. Perhaps the init script could provide better feedback about the daemon/inetd situation even if nothing else is done.

There are some reasonable tradeoffs between using inet and running
standalone, and it's possible to run tftpd-hpa in either mode. Which
one is better depends on the use case, so we should preserve the
ability to choose. However, I also usually use standalone (i.e. not
inet), and I agree that the whole thing, including the defaults,
should be rethought and streamlined.

>>attempts to purge it would remove tftpd-hpa
The problem here isn't the package or the dependencies (which are
correctly stated); it's the package manager. Apt-get and the graphical
managers often don't "Do the Right Thing" (tm). Instead, use aptitude
for package management. It almost always gets the answers right, and
when there are alternative solutions, it presents choices for the
system admin. If you need very fine-grained control, aptitude's
full-screen mode is unbelievably powerful, and allows you to play
minesweeper on just about any computer in the world. :-)

Happy Trails,

Loye Young
Isaac & Young Computer Company
Laredo, Texas

Mark Alan (malan) wrote :

To run tftpd-hpa as a daemon:

#purge old config
sudo aptitude purge tftpd-hpa openbsd-inetd

# install only tftpd-hpa
sudo aptitude -R install tftpd-hpa

# enable RUN_DAEMON
sudo sed -i 's/.*RUN_DAEMON.*/RUN_DAEMON="yes"/' /etc/default/tftpd-hpa

# disable tftp inetd supervision
sudo sed -i 's/^tftp/#<off># tftp/' /etc/inetd.conf # has the same effect as: sudo update-inetd --disable tftp

## if needed
sudo update-rc.d -f tftpd-hpa remove # remove auto boot
sudo update-rc.d tftpd-hpa start 20 2 3 4 5 . stop 20 1 . # reinstall auto boot
# sudo /etc/init.d/tftpd-hpa restart is broken (the restart script exits after executing the first stop), use instead:
sudo /etc/init.d/tftpd-hpa stop
sudo /etc/init.d/tftpd-hpa start

Hardik Dalwadi (hardik-dalwadi) wrote :

I am not able observer / reproduce this issue in Ubuntu 9.04.

jtk (jtk) wrote :

When I install tftp-hpa in karmic (9.10) installs openbsd-inetd. Both the startup scripts for these two packages are installed in /etc/init.d/. However, by default tftp-hpa is set to not run by default with the RUN_DAEMON=yes set while openbsd-inetd starts up tftpd anyway, because of its default /etc/inetd.conf. I like the tftp-hpa default behavior best. If for some reason openbsd-inetd is needed, then, I'd prefer inetd.conf disable in.tftpd by default.

Thierry Carrez (ttx) wrote :

tftpd-hpa no longer supports running with inetd (since >=5.0-1 as shipped in Lucid) so this bug is no longer relevant.

Changed in tftp-hpa (Ubuntu):
status: Confirmed → Fix Released
Changed in server-papercuts:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers