How to start a tftp server in ubuntu using systemctl start tftp command?

Solution 1:

Please modify you service file from:

[Unit]
Description=Tftp Server

[Service]
ExecStart=/usr/sbin/in.tftpd
ExecStop=/bin/kill -15 $MAINPID

StandardInput=socket

[Install]
WantedBy=multi-user.target

To this since it's a daemon:

[Unit]
Description=Tftp Server

[Service]
Type=forking
ExecStart=/usr/sbin/xinetd
ExecStop=/bin/kill -15 $MAINPID
StandardInput=socket

[Install]
WantedBy=multi-user.target

Sources:

http://www.linuxcertif.com/man/5/systemd.service/

https://linux.die.net/man/8/xinetd