Bug 1129246 - YaST2 doesn't start tftp service properly
YaST2 doesn't start tftp service properly
Status: RESOLVED DUPLICATE of bug 1153625
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Pedro Monreal Gonzalez
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-14 13:07 UTC by Rubén Torrero Marijnissen
Modified: 2021-04-15 15:38 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
yast2 logs (4.03 MB, application/x-compressed-tar)
2019-03-20 10:12 UTC, Rubén Torrero Marijnissen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rubén Torrero Marijnissen 2019-03-14 13:07:00 UTC
When using YaST to configure my tftp server, I have the option to start the service, using the "After writing configuration" dropdown, by selecting "start"

After doing so, it still doesn't seem to work. systemctl status tftp reports:

$ systemctl status tftp       
● tftp.service - Tftp Server
   Loaded: loaded (/usr/lib/systemd/system/tftp.service; static; vendor preset: disabled)
   Active: failed (Result: resources)


journalctl shows:

mar 14 11:50:25 nobill-desktop systemd[1]: tftp.service: Got no socket.
mar 14 11:50:25 nobill-desktop systemd[1]: tftp.service: Failed to run 'start' task: Invalid argument
mar 14 11:50:25 nobill-desktop systemd[1]: tftp.service: Failed with result 'resources'.
mar 14 11:50:25 nobill-desktop systemd[1]: Failed to start Tftp Server.


If I start tftp.socket and restart tftp, it seems to work fine:

$ systemctl start tftp.socket
$ systemctl start tftp
$ systemctl status tftp
● tftp.service - Tftp Server
   Loaded: loaded (/usr/lib/systemd/system/tftp.service; static; vendor preset: disabled)
   Active: active (running) since Thu 2019-03-14 13:03:28 WET; 5s ago
 Main PID: 21468 (in.tftpd)
    Tasks: 1 (limit: 4915)
   Memory: 208.0K
   CGroup: /system.slice/tftp.service
           └─21468 /usr/sbin/in.tftpd -u tftp -s /srv/tftpboot
Comment 1 Ancor Gonzalez Sosa 2019-03-15 13:34:58 UTC
Please provide YaST logs to see what yast2-tftp tried exactly

https://en.opensuse.org/openSUSE:Report_a_YaST_bug
Comment 2 Rubén Torrero Marijnissen 2019-03-20 10:12:06 UTC
Created attachment 800671 [details]
yast2 logs

The interesting part IMO:

...
./YaST2/y2log:2019-03-14 11:50:25 <1> nobill-desktop(15310) [Ruby] yast2/systemctl.rb:34 systemctl start tftp.service 
./YaST2/y2log:2019-03-14 11:50:25 <3> nobill-desktop(15310) [bash] ShellCommand.cc(shellcommand):78 Job for tftp.service failed because of unavailable resources or another system error.
./YaST2/y2log:2019-03-14 11:50:25 <3> nobill-desktop(15310) [bash] ShellCommand.cc(shellcommand):78 See "systemctl status tftp.service" and "journalctl -xe" for details.
...
Comment 3 Ancor Gonzalez Sosa 2019-03-22 13:55:51 UTC
The main reason of the problem is that the tftp service needs it socket running to start gracefully.

We could try to fix YaST to ensure it starts the socket unit before starting the service unit, but in fact and according to the systemd documentation[1], making it work is the responsibility of the service. It should start the socket if it is required for the service to run by adding the corresponding dependencies to the systemd units. So I consider this a bug in the tftp package. Reassigning to its bugowner.

[1] https://www.freedesktop.org/software/systemd/man/systemd.socket.html

If you are curious about some possible solutions we discussed to fix this at YaST level (before concluding it was a tftp-server bug), see https://github.com/yast/yast-tftp-server/pull/27
Comment 4 Pedro Monreal Gonzalez 2019-07-03 15:09:30 UTC
(In reply to Ancor Gonzalez Sosa from comment #3)
> ... It should start the
> socket if it is required for the service to run by adding the corresponding
> dependencies to the systemd units...

Yes, you are right, I'll add a socket requires in the Unit section of the service. That would start the socket on demand. I'll submit now.
Comment 5 Pedro Monreal Gonzalez 2019-07-03 15:31:47 UTC
I just committed the changes to my branch, you can check the packages here:

https://download.opensuse.org/repositories/home:/pmonrealgonzalez:/branches:/network/openSUSE_Tumbleweed/

Let me know if they work as expected using YaST and/or if you need something else.
Comment 6 Pedro Monreal Gonzalez 2019-10-14 17:20:28 UTC
Closing. Duplicated of bsc#1153625.

*** This bug has been marked as a duplicate of bug 1153625 ***