Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 812476 - net-misc/iputils create /var/lib/tftpboot folder for tftp
Summary: net-misc/iputils create /var/lib/tftpboot folder for tftp
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-10 19:00 UTC by jospezial
Modified: 2021-10-09 14:53 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jospezial 2021-09-10 19:00:27 UTC
/etc/xinetd.d/tftp has
      server_args     = /var/lib/tftpboot

Why not create this folder (with test for existing) if the package is emerged?
I did not look into the other services.
Comment 1 Mike Gilbert gentoo-dev 2021-09-10 19:06:36 UTC
I see that it also defaults to running as 'nobody', which is probably a bad idea. It would probably be worthwhile to create a dedicated user for tftp daemons (acct-user/tftp).
Comment 2 SpanKY gentoo-dev 2021-09-10 23:07:09 UTC
guessing you didn't mean iputils since that doesn't provide tftp

packages must not create /var paths in the ebuild itself.  we can have its init.d script use checkpath, and install a tmpfiles.d for the xinetd usage.

a dedicated user is fine, but it's not a super big deal since it's a read-only service.
Comment 3 Mike Gilbert gentoo-dev 2021-09-11 01:21:54 UTC
(In reply to SpanKY from comment #2)
> guessing you didn't mean iputils since that doesn't provide tftp

The iputils ebuild has USE flags for tftp and tftpd. I have no idea where you got this idea from.
Comment 4 Mike Gilbert gentoo-dev 2021-09-11 01:25:32 UTC
(In reply to SpanKY from comment #2)
> packages must not create /var paths in the ebuild itself.

It is fairly common for ebuilds to keepdir paths below /var/lib.
Comment 5 Mike Gilbert gentoo-dev 2021-09-11 01:34:37 UTC
(In reply to SpanKY from comment #2)
> a dedicated user is fine, but it's not a super big deal since it's a
> read-only service.

Looking through tftpd.c in the iputils source, it does appear to support receiving files from the client.
Comment 6 jospezial 2021-09-11 07:30:17 UTC
(In reply to SpanKY from comment #2)
> guessing you didn't mean iputils since that doesn't provide tftp
> 

> a dedicated user is fine, but it's not a super big deal since it's a
> read-only service.

You can push files to the server. so rw.
Comment 7 SpanKY gentoo-dev 2021-09-12 07:44:28 UTC
(In reply to Mike Gilbert from comment #4)
> (In reply to SpanKY from comment #2)
> > packages must not create /var paths in the ebuild itself.
> 
> It is fairly common for ebuilds to keepdir paths below /var/lib.

those ebuilds are all broken and violating QA.  existing broken code is not justification for adding more.
Comment 8 Mike Gilbert gentoo-dev 2021-09-12 12:51:07 UTC
(In reply to SpanKY from comment #7)
> those ebuilds are all broken and violating QA.  existing broken code is not
> justification for adding more.

There is no Gentoo policy that says "do not install things in /var/lib".
Comment 9 Mike Gilbert gentoo-dev 2021-09-12 14:12:30 UTC
It looks like tftpd is likely to be removed upstream.

https://github.com/iputils/iputils/issues/363
Comment 10 Mike Gilbert gentoo-dev 2021-09-12 18:00:35 UTC
If you want to see a change in that policy(In reply to SpanKY from comment #7)
> those ebuilds are all broken and violating QA.  existing broken code is not
> justification for adding more.

I can imagine for some use cases that it might be useful to treat /var as a completely volatile data store that can be wiped out at any time. However, current Gentoo ebuild policy/practice does not require supporting this. Arguing about this on a random bug report will not be very productive.

If this is something you want to pursue, here are some suggested next steps:

1. Propose a policy on the gentoo-dev mailing list, and listen to the feedback/suggestions.

2. Update the Gentoo policy guide.

https://projects.gentoo.org/qa/policy-guide/index.html

3. Update the related install QA check.

https://gitweb.gentoo.org/repo/gentoo.git/tree/metadata/install-qa-check.d/08gentoo-paths

4. Update the existing ebuilds that install directories under /var.
Comment 11 SpanKY gentoo-dev 2021-10-09 06:11:13 UTC
(1) portage has been warning about it for years:
https://gitweb.gentoo.org/proj/portage.git/tree/bin/install-qa-check.d/20runtime-directories

(2) this is the entire point of checkpath & tmpfiles.d.

(3) having /var/lib or similar paths wiped or broken should not require an unmerge & re-emerge of a package to easily recover.

(4) it goes against FHS.  read bug 493154 for details.

there is absolutely no reason for an ebuild to install into /var.  if an ebuild tries to, it's doing it wrong, and it's broken, and needlessly so.

all that said, it's a moot point since iputils is removing tftpd support.  so punting this request.
Comment 12 Mike Gilbert gentoo-dev 2021-10-09 14:53:34 UTC
(In reply to SpanKY from comment #11)

Interesting. If we are going to enforce that for /var/lib, the QA check should really get updated to include it.