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:
I've checked its config /etc/defaults/tftpd-hpa, and its contents were fine: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)
Code: Select all
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"
Trying to reconfigure (sudo dpkg-reconfigure tftpd-hpa) also failed: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)
/var/log/syslog gave a hint, why the configure script reports a problem:/usr/sbin/dpkg-reconfigure: tftpd-hpa is broken or not fully installed
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
[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"
Code: Select all
sudo apt-get install -f
(Optional) Check if the process is running: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.
Code: Select all
ps aux | grep tftpd
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