无法设置 tftpd-hpa

无法设置 tftpd-hpa

我见过有人讨论这个问题,但似乎没有人知道答案。

当我尝试启动 tftpd-hpa 时,通过以下命令:

/etc/init.d/tftpd-hpa start

我得到的回报是:

    [....] Starting tftpd-hpa (via systemctl): tftpd-hpa.serviceJob for tftpd-
hpa.service failed because the control process exited with error code. See 

"systemctl status tftpd-hpa.service" and "journalctl -xe" for details.

     failed!

我的/etc/default/tftpd-hpa

# /etc/default/tftpd-hpa

TFTP_USERNAME="fly!"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"
RUN_DAEMON="yes" # maybe no need for that
#OPTIONS="-l -s /var/lib/tftpboot"

输出systemctl status tftpd-hpa.service

● tftpd-hpa.service - LSB: HPA's tftp server
   Loaded: loaded (/etc/init.d/tftpd-hpa; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Пн 2016-11-28 19:45:33 +05; 4min 38s
     Docs: man:systemd-sysv-generator(8)
  Process: 3217 ExecStart=/etc/init.d/tftpd-hpa start (code=exited, status=1/FAI

ноя 28 19:45:33 serverubuntu systemd[1]: Starting LSB: HPA's tftp server...
ноя 28 19:45:33 serverubuntu tftpd-hpa[3217]:  * Starting HPA's tftpd in.tftpd
ноя 28 19:45:33 serverubuntu tftpd-hpa[3217]: /tftpboot missing, aborting.
ноя 28 19:45:33 serverubuntu systemd[1]: tftpd-hpa.service: Control process exit
ноя 28 19:45:33 serverubuntu systemd[1]: Failed to start LSB: HPA's tftp server.
ноя 28 19:45:33 serverubuntu systemd[1]: tftpd-hpa.service: Unit entered failed 
ноя 28 19:45:33 serverubuntu systemd[1]: tftpd-hpa.service: Failed with result '
lines 1-13/13 (END)

为什么不起作用?如何修复它?

操作系统 - Ubuntu 服务器 16.04 LTS

  • 我参观过这个启动板错误报告#1342580

    并更改0:690.0.0.0:69,我还将行 ' start on' 条件更改/etc/init/tftpd-hpa.conf为:

    start on (filesystem and net-device-up IFACE!=lo)
    

    它也不起作用。

答案1

路径错误:

ноя 28 19:45:33 serverubuntu tftpd-hpa[3217]: /tftpboot missing, aborting.

tftpd-hpa正在寻找/tftpboot我希望您遵循官方 PXE 教程的位置,该教程将其设置为/var/lib/tftpboot

快速修复,取消注释以下行/etc/default/tftpd-hpa

OPTIONS="-l -s /var/lib/tftpboot"

答案2

我有同样的问题如下:

root@ubuntu:/# sudo service tftpd-hpa restart
Job for tftpd-hpa.service failed because the control process exited with error code. See "systemctl status tftpd-hpa.service" and "journalctl -xe" for details.

root@ubuntu:/etc/default# vi tftpd-hpa

# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="\tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -c -s"

更改TFTP_DIRECTORY="\tftpboot"为后TFTP_DIRECTORY="/tftpboot",它的工作原理:

root@ubuntu:/# /etc/init.d/tftpd-hpa start
[ ok ] Starting tftpd-hpa (via systemctl): tftpd-hpa.service.

答案3

我有同样的问题,我使用的是 Debian 10。

执行以下命令:

sudo apt install tftpd-hpa

安装后,需要编辑配置文件,在文本编辑器中打开:

sudo nano /etc/default/tftpd-hpa

然后将文件设置为如下所示:

TFTP_USERNAME="nobody"
TFTP_DIRECTORY="/tftpboot/"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure --create -v"

创建文件目录并分配权限:

sudo mkdir /srv/tftp
sudo chown tftp:tftp /srv/tftp

重新启动 TFTP 服务器以应用更改:

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

我收到了有关的说明https://ixnfo.com/en/install-and-configure-tftpd-hpa.html

答案4

就我而言,该服务tftpd已随 一起安装tftp-hpa

我收到的错误是:

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

[....] Restarting tftpd-hpa (via systemctl): tftpd-hpa.serviceJob for tftpd-hpa.service failed because the control process exited with error code.
See "systemctl status tftpd-hpa.service" and "journalctl -xe" for details.
 failed!

当我进行状态调用时:

sudo service tftpd-hpa status

● tftpd-hpa.service - LSB: HPA's tftp server
   Loaded: loaded (/etc/init.d/tftpd-hpa; generated)
   Active: failed (Result: exit-code) since Thu 2020-06-04 19:39:04 IST; 8min ago
     Docs: man:systemd-sysv-generator(8)

Jun 04 19:39:04 sophos systemd[1]: Starting LSB: HPA's tftp server...
Jun 04 19:39:04 sophos tftpd-hpa[2526]:  * Starting HPA's tftpd in.tftpd
Jun 04 19:39:04 sophos systemd[1]: tftpd-hpa.service: Control process exited, code=exited, status=1/FAILURE
Jun 04 19:39:04 sophos systemd[1]: tftpd-hpa.service: Failed with result 'exit-code'.
Jun 04 19:39:04 sophos systemd[1]: Failed to start LSB: HPA's tftp server.

所以我删除了 tftpd:

sudo apt-get purge tftpd -y

然后重启服务:

sudo service tftpd-hpa restart

服务开始运行:

sudo service tftpd-hpa status

● tftpd-hpa.service - LSB: HPA's tftp server
   Loaded: loaded (/etc/init.d/tftpd-hpa; generated)
   Active: active (exited) since Thu 2020-06-04 19:47:22 IST; 4s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3152 ExecStart=/etc/init.d/tftpd-hpa start (code=exited, status=0/SUCCESS)

Jun 04 19:47:22 sophos systemd[1]: Starting LSB: HPA's tftp server...
Jun 04 19:47:22 sophos systemd[1]: Started LSB: HPA's tftp server.

谢谢。

相关内容