3

I am using ubuntu 16.04 I have installed tftpd-hpa server. I want to start my server with systemctl start tftp command. I have created a tftp service file in system folder and the configuration is as follows

[Unit]
Description=Tftp Server
After=network.target

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


[Install]
WantedBy=multi-user.target

Whenever I am running the

systemctl start tftp

I am getting the following message :

Job for tftp.service failed because a configured resource limit was exceeded. See "systemctl status tftp.service" and "journalctl -xe" for details.

After executing:

systemctl status tftp.service 

I am getting the following message :

● tftp.service - Tftp Server
   Loaded: loaded (/etc/systemd/system/tftp.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2017-07-26 14:38:22 IST; 26s ago
  Process: 3309 ExecStart=/usr/sbin/in.tftpd /var/tftp (code=exited, status=1/FAILURE)

Jul 26 14:38:22 map-VB systemd[1]: Starting Tftp Server...
Jul 26 14:38:22 map-VB systemd[1]: tftp.service: Control process exited, code=exited status=1
Jul 26 14:38:22 map-VB systemd[1]: Failed to start Tftp Server.
Jul 26 14:38:22 map-VB systemd[1]: tftp.service: Unit entered failed state.
Jul 26 14:38:22 map-VB systemd[1]: tftp.service: Failed with result 'exit-code'.

Any guidance is greatly appreciated.

after running

journalctl -xe

It gave following message

-- Unit acpid.service has finished starting up.
-- 
-- The start-up result is done.
Jul 26 14:38:15 map-VB systemd[1]: Started CUPS Scheduler.
-- Subject: Unit cups.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit cups.service has finished starting up.
-- 
-- The start-up result is done.
Jul 26 14:38:15 map-VB polkitd(authority=local)[841]: Unregistered Authentication Agent for unix-process:3270:263001 (system bus name :1.147, 
Jul 26 14:38:17 map-VB polkitd(authority=local)[841]: Registered Authentication Agent for unix-process:3300:263641 (system bus name :1.159 [/u
Jul 26 14:38:17 map-VB gnome-session[1420]: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
Jul 26 14:38:22 map-VB polkitd(authority=local)[841]: Operator of unix-session:c1 successfully authenticated as unix-user:map to gain TEMPORAR
Jul 26 14:38:22 map-VB systemd[1]: Starting Tftp Server...
-- Subject: Unit tftp.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit tftp.service has begun starting up.
Jul 26 14:38:22 map-VB tftpd[3309]: recvfrom: Socket operation on non-socket
Jul 26 14:38:22 map-VB systemd[1]: tftp.service: Control process exited, code=exited status=1
Jul 26 14:38:22 map-VB systemd[1]: Failed to start Tftp Server.
-- Subject: Unit tftp.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit tftp.service has failed.
-- 
-- The result is failed.
Jul 26 14:38:22 map-VB systemd[1]: tftp.service: Unit entered failed state.
Jul 26 14:38:22 map-VB systemd[1]: tftp.service: Failed with result 'exit-code'.
Jul 26 14:38:22 map-VB polkitd(authority=local)[841]: Unregistered Authentication Agent for unix-process:3300:263641 (system bus name :1.159, 
Jul 26 14:54:57 map-VB org.gnome.evolution.dataserver.Sources5[1300]: ** (evolution-source-registry:2124): WARNING **: secret_service_search_s
Jul 26 15:00:52 map-VB compiz[1963]: gkr-pam: unlocked login keyring
ams
  • 203
  • 2
  • 6
  • 12

1 Answers1

3

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

Whois_me
  • 116
  • 13
George Udosen
  • 35,970
  • 13
  • 99
  • 121
  • Thanks @George. But it's not working. I edited my tftp.services file in the question and now I am getting less errors. So please check it and if possible tell me where I am wrong. – ams Jul 26 '17 at 09:12
  • Please run `journalctl -xe` and lets see the output, add to your code don't remove any old entries jut add under as an update – George Udosen Jul 26 '17 at 09:30
  • I ran the journalctl -xe command please check the output in question description. Thank You. – ams Jul 26 '17 at 09:42
  • Please run `which xinetd` and tell me what comes out – George Udosen Jul 26 '17 at 09:56
  • Output: /usr/sbin/xinetd – ams Jul 26 '17 at 09:58
  • ok that's the problem, it should be run like `/user/sbin/xinetd` not `/usr/sbin/in.tftpd ` – George Udosen Jul 26 '17 at 10:20
  • Oh great it worked if my updated answer helped please accept it. – George Udosen Jul 26 '17 at 10:47
  • Hi, I am facing a problem when I am starting a tftp server. Here, I am using inetd not xinetd . Error is : Failed to start etc-init.d-tftpd.mount: Unit etc-init.d-tftpd.mount failed to load: No such file or directory. Can you please help me out I tried various ways to solve but I am not able to solve this problem. Thank You ..! – ams Aug 08 '17 at 07:13
  • @ams please start a new question – George Udosen Aug 08 '17 at 07:43
  • I just posted a new question. Please have a look on it. Thank You – ams Aug 08 '17 at 09:39