KenjiBrown/without-systemd

Replace opentmpfiles with tmpfilesd?

Opened this issue · 13 comments

orbea commented

Maybe it would be a good idea to offer tmpfilesd? opentmpfiles is not maintained and tmpfilesd offers all of the same options that appear to be used in the Gentoo init.

https://github.com/juur/tmpfilesd

$ ./tmpfilesd -h
Usage: tmpfilesd [OPTIONS]... [CONFIGURATION FILE]...
Manage tmpfiles entries

  -h, --help                 show help
      --version              show version number
      --create               create or write to files
      --clean                clean up files or folders
      --remove               remove directories or filse
      --boot                 also execute lines with a !
      --prefix=PATH          only apply rules with a matching path
      --exclude-prefix=PATH  ignores rules with paths that match
      --root=ROOT            all paths including config will be prefixed
# grep -r systemd-tmpfiles
init.d/systemd-tmpfiles-setup-dev:	systemd-tmpfiles --prefix=/dev --create --boot
init.d/systemd-tmpfiles-setup:	systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev
cron.daily/systemd-tmpfiles-clean:exec ionice -c idle -t systemd-tmpfiles --clean
orbea commented

I'm getting these QA Notices.

* QA Notice: The ebuild is installing to one or more unexpected paths:
 * 
 *   /tmpfilesd-clean
 * 
 * Please fix the ebuild to use correct FHS/Gentoo policy paths.
 * QA Notice: package is installing tmpfiles without inheriting tmpfiles.eclass!
 * Packages must inherit tmpfiles.eclass then call tmpfiles_process in pkg_postinst.

The systemd-utils ebuild does:

exeinto /etc/cron.daily
doexe "${FILESDIR}"/systemd-tmpfiles-clean

You may also want to have it install /bin/tmpfilesd instead of /usr/bin/tmpfilesd to match /bin/systemd-tmpfiles from systemd-utils.

I am unsure about the tmpfiles.eclass QA Notice, I don't see how systemd-utils handles it?

tmpfilesd-clean should install in /etc/cron.daily
Fixed.

Install tmpfilesd in /bin/tmpfilesd should be changed in Makefile.in but I don't know how.
We should better ask upstream.

orbea commented

Why not just pass --bindir="${EPREFIX}"/bin to configure?

New ebuild passes --bindir="${EPREFIX}"/bin to configure
I have also added support for tmpfiles eclass to fix other warnings.
Can you try the ebuild?

orbea commented

Yes, seems better on my end.

For reference here is the contents of systemd-utils:

/bin
/bin/systemd-tmpfiles
/etc
/etc/cron.daily
/etc/cron.daily/systemd-tmpfiles-clean
/etc/init.d
/etc/init.d/systemd-tmpfiles-setup
/etc/init.d/systemd-tmpfiles-setup-dev
/usr
/usr/lib
/usr/lib/tmpfiles.d
/usr/lib/tmpfiles.d/etc.conf
/usr/lib/tmpfiles.d/legacy.conf
/usr/lib/tmpfiles.d/static-nodes-permissions.conf
/usr/lib/tmpfiles.d/tmp.conf
/usr/lib/tmpfiles.d/var.conf
/usr/lib/tmpfiles.d/x11.conf
/usr/share
/usr/share/doc
/usr/share/doc/systemd-utils-254.5-r1
/usr/share/doc/systemd-utils-254.5-r1/NEWS.gz
/usr/share/doc/systemd-utils-254.5-r1/README.gz
/usr/share/doc/systemd-utils-254.5-r1/README.md.gz
/usr/share/doc/systemd-utils-254.5-r1/TODO.gz
/usr/share/man
/usr/share/man/man5
/usr/share/man/man5/tmpfiles.d.5.gz
/usr/share/man/man8
/usr/share/man/man8/systemd-tmpfiles.8.gz
/usr/share/zsh
/usr/share/zsh/site-functions
/usr/share/zsh/site-functions/_systemd-tmpfiles

compared with tmpfilesd:

/bin
/bin/tmpfilesd
/etc
/etc/conf.d
/etc/conf.d/tmpfilesd-dev
/etc/conf.d/tmpfilesd-setup
/etc/cron.daily
/etc/cron.daily/tmpfilesd-clean
/etc/init.d
/etc/init.d/tmpfilesd-dev
/etc/init.d/tmpfilesd-setup
/usr
/usr/lib
/usr/lib/tmpfiles.d
/usr/lib/tmpfiles.d/etc.conf
/usr/lib/tmpfiles.d/legacy.conf
/usr/lib/tmpfiles.d/sap.conf
/usr/lib/tmpfiles.d/var.conf
/usr/lib/tmpfiles.d/x11.conf
/usr/share
/usr/share/doc
/usr/share/doc/tmpfilesd-9999
/usr/share/doc/tmpfilesd-9999/README.md.gz
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/tmpfilesd.8.gz

What is the reason for skipping systemd-nologin.conf, systemd.conf and tmp.conf? systemd-utils does provide tmp.conf even without systemd, but I am not sure its important to copy that for tmpfilesd?

These files are useless unless systemd is enabled.
They might be set to be installed with USE=systemd

I will be watching for upstream to tag a release for keywording a release ebuild.

orbea commented

I made an issue for upstream asking for a release tag.

juur/tmpfilesd#4

orbea commented

Upstream kindly made a release tag!

https://github.com/juur/tmpfilesd/releases/tag/v0.1.0

orbea commented

In the 9999 version there have been changes which removed most of the conf files.

https://github.com/juur/tmpfilesd/tree/56cac272e1beb3dd72b345f82439ff519c29e99c/misc/tmpfiles-d

fixed 9999 ebuild.
Also added ebuilds for 0.1.0, 0.1.1 and 0.1.2
Release ebuilds are ~keyworded. I would like to know your opinion about stabilizing 0.1.2 so It can be elegible to satisfy virtual/tmpfiles.