Page 1 of 1

Why does tftp-server install a systemd service

Posted: 2018/01/02 19:11:01
by afalanga
I'm struggling to understand why the package tftp-server installs a systemd service, tftp.service and tftp.socket, when it's managed through xinetd which is also a service. My understanding is that xinetd listens on the well-known service sockets and then, when something happens on the tftp socket, it starts tftpd. So, why the need for a separate service? Does xinetd start things things through systemd? Is that why? Or is it just in case I'd rather have tftp running all the time and not depend upon a "middle-man?"

My reason for this question
$ rpm -ql tftp-server
/etc/xinetd.d/tftp
/usr/lib/systemd/system/tftp.service
/usr/lib/systemd/system/tftp.socket
/usr/sbin/in.tftpd
/usr/share/doc/tftp-server-5.2
/usr/share/doc/tftp-server-5.2/CHANGES
/usr/share/doc/tftp-server-5.2/README
/usr/share/doc/tftp-server-5.2/README.security
/usr/share/man/man8/in.tftpd.8.gz
/usr/share/man/man8/tftpd.8.gz
/var/lib/tftpboot

Why does tftp-server install a systemd service

Posted: 2019/09/14 00:02:07
by hupcey
Did you ever figure this out or get an answer anywhere? It constantly baffles our folks who think the TFTP server is DEAD, because the status always says:

>systemctl status tftp
* tftp.service - Tftp Server
Loaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor preset: disabled)
Active: inactive (dead) since Wed 2019-09-04 14:19:38 PDT; 1 weeks 2 days ago
Docs: man:in.tftpd
Main PID: 374498 (code=exited, status=0/SUCCESS)

Sep 04 14:04:38 pe-ld3 systemd[1]: Started Tftp Server.
Sep 04 14:04:38 pe-ld3 systemd[1]: Starting Tftp Server...

But of course when you request a TFTP transfer then xinetd starts the tftpd server OK:
root 268819 336559 0 16:19 ? 00:00:00 in.tftpd --verbose -s /var/lib/tftpboot

There is also a tftp.socket which is active:
>systemctl status tftp.socket
* tftp.socket - Tftp Server Activation Socket
Loaded: loaded (/usr/lib/systemd/system/tftp.socket; enabled; vendor preset: disabled)
Active: active (listening) since Fri 2019-07-26 16:36:28 PDT; 1 months 18 days ago
Listen: 0.0.0.0:69 (Datagram)

Jul 26 16:36:28 pe-ld3 systemd[1]: Listening on Tftp Server Activation Socket.
Jul 26 16:36:28 pe-ld3 systemd[1]: Starting Tftp Server Activation Socket.

But when the remote system hangs in PXE boot people always blame TFTP because they say that issuing a "systemctl start tftp" then makes the PXE boot work!

Thanks,
John

Re: Why does tftp-server install a systemd service

Posted: 2019/09/14 00:40:52
by TrevorH
I'm pretty sure you shouldn't be using xinetd for tftp if you have also enabled the tftpd.socket in systemd. They do the same thing (only differently).