Raspberry Pi: error processing tftpd-hpa (--configure)

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1480
Joined: Fri Aug 29, 2003 8:39 pm

Raspberry Pi: error processing tftpd-hpa (--configure)

Post by ^rooker »

[PROBLEM]
I'm in the middle of configuring my Raspberry Pi to work as a PXE boot server.

Installing the "tftpd-hpa" package (apt-get), ends in the following error message:
Setting up tftpd-hpa (5.2-4) ...
Starting HPA's tftpd: in.tftpdinvoke-rc.d: initscript tftpd-hpa, action "start" failed.
dpkg: error processing tftpd-hpa (--configure):
subprocess installed post-installation script returned error exit status 71
Errors were encountered while processing:
tftpd-hpa
E: Sub-process /usr/bin/dpkg returned an error code (1)
I've checked its config /etc/defaults/tftpd-hpa, and its contents were fine:

Code: Select all

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"
I suspected that this was, because I hadn't installed any inetd yet, but "apt-get install inetutils-inetd" also ended in an error:
Setting up tftpd-hpa (5.2-4) ...
tftpd user (tftp) already exists, doing nothing.

tftpd-hpa directory (/srv/tftp) already exists, doing nothing.
Starting HPA's tftpd: in.tftpdinvoke-rc.d: initscript tftpd-hpa, action "start" failed.
dpkg: error processing tftpd-hpa (--configure):
subprocess installed post-installation script returned error exit status 71
Setting up inetutils-inetd (2:1.9-1) ...
Not starting internet superserver: no services enabled. ... (warning).
Errors were encountered while processing:
tftpd-hpa
E: Sub-process /usr/bin/dpkg returned an error code (1)
Trying to reconfigure (sudo dpkg-reconfigure tftpd-hpa) also failed:
/usr/sbin/dpkg-reconfigure: tftpd-hpa is broken or not fully installed
/var/log/syslog gave a hint, why the configure script reports a problem:

Code: Select all

Feb 23 22:55:38 rasputin in.tftpd[27342]: cannot open IPv6 socket, disable IPv6: Address family not supported by protocol
Feb 23 22:55:38 rasputin in.tftpd[27342]: Cannot set nonblock flag on socket: Bad file descriptor
This could be related to bug #544089 "tftpd-hpa: Does not start when Ipv6 is not available".

[SOLUTION]
Thanks to a post by "cyrylio" in the Raspberry Pi Forums, the solution is to add "--ipv4" to tftpd's startup options in /etc/default/tftpd-hpa, so it looks like this:

Code: Select all

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure --ipv4"
Then finish the broken package installation:

Code: Select all

sudo apt-get install -f
Should return:
Setting up tftpd-hpa (5.2-4) ...
tftpd user (tftp) already exists, doing nothing.

tftpd-hpa directory (/srv/tftp) already exists, doing nothing.
Starting HPA's tftpd: in.tftpd.
(Optional) Check if the process is running:

Code: Select all

ps aux | grep tftpd
Should return something like this:
root 27694 0.0 0.0 2332 300 ? Ss 23:08 0:00 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure --ipv4 /srv/tftp
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply