FS#52781 - [filesystem] support /usr/share/factory

Attached to Project: Arch Linux
Opened by Stefan Majewsky (majewsky) - Monday, 30 January 2017, 23:06 GMT
Last edited by Sébastien Luttringer (seblu) - Sunday, 10 December 2017, 16:04 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Sébastien Luttringer (seblu)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

systemd documentation [1] recommends to use the directory /usr/share/factory/etc as a "Repository for vendor-supplied default configuration files. This directory should be populated with pristine vendor versions of all configuration files that may be placed in /etc. This is useful to compare the local configuration of a system with vendor defaults and to populate the local configuration with defaults."

In this case, "vendor" means Arch Linux. Most of those "vendor-supplied default configuration files" come from the filesystem package, so I would consider it appropriate to install a copy of these to /usr/share/factory/etc, for the reasons described in the quote from above.

Currently, my /usr/share/factory/etc only contains some stuff installed by systemd:

$ find /usr/share/factory/etc -exec pacman -Qo {} +
/usr/share/factory/etc/ is owned by systemd 232-7
/usr/share/factory/etc/pam.d/ is owned by systemd 232-7
/usr/share/factory/etc/pam.d/other is owned by systemd 232-7
/usr/share/factory/etc/pam.d/system-auth is owned by systemd 232-7
/usr/share/factory/etc/nsswitch.conf is owned by systemd 232-7

And this is really bad: /etc/nsswitch.conf and /etc/pam.d/{other,system-auth} are installed by different packages (filesystem and pambase, respectively), but with completely different contents. This should be cleaned up, so that users can rely on the expectation set by systemd's documentation (which is also installed as the authoritative-looking file-hierarchy(7) manpage).

The concrete use-case that provoked me to file this task was that I plan to write an audit tool for the users and groups that are present on my systems, and I would like to have a base against which to diff. Sure, I could `tar xf /var/cache/pacman/pkg/filesystem-$(pacman -Q filesystem | cut -d' ' -f2)-x86_64.pkg.tar.xz`, but that's plain ugly and relies on the existence of a package cache. It would be much nicer if I had /usr/share/factory/etc/{group,gshadow,passwd,shadow} at my disposal.

[1] https://www.freedesktop.org/software/systemd/man/file-hierarchy.html
Closed by  Sébastien Luttringer (seblu)
Sunday, 10 December 2017, 16:04 GMT
Reason for closing:  Fixed
Additional comments about closing:  filesystem 2017.10-2
Comment by Stefan Majewsky (majewsky) - Monday, 30 January 2017, 23:09 GMT
Oops, wrong category. Can someone please move this to "Packages: Core"?
Comment by Sébastien Luttringer (seblu) - Sunday, 26 March 2017, 20:59 GMT
partially done in 2017.03, waiting for systemd to remove nsswitch.conf
Comment by Eli Schwartz (eschwartz) - Sunday, 26 March 2017, 21:30 GMT
For the record, that `tar xf /var/cache/pacman/pkg/filesystem-$(pacman -Q filesystem | cut -d' ' -f2)-x86_64.pkg.tar.xz` also breaks on e.g. packages with the "any" arch, and would in general be a lot more elegant with `expac '%n-%v-%a.pkg.tar.xz' filesystem`. Or use pacman -Sp to get the download url from the sync database (pacman-git will print the CacheDir location if the package is in the pacman cache).
Comment by Dave Reisner (falconindy) - Tuesday, 11 April 2017, 13:40 GMT
As part of removing factory files from other packages, filesystem will need to gain its own tmpfiles fragment with the corresponding C directives.
Comment by Sébastien Luttringer (seblu) - Thursday, 31 August 2017, 00:23 GMT
Now in trunk. A test package is available here: http://pkgbuild.com/~seblu/filesystem-2017.08-0.3-x86_64.pkg.tar.xz.
Comment by Dave Reisner (falconindy) - Saturday, 02 September 2017, 21:36 GMT
It's broken. See  FS#55467 .
Comment by Sébastien Luttringer (seblu) - Sunday, 03 September 2017, 21:45 GMT
Fixed in filesystem-2017.09-1.

Loading...