packages need to be able to cope with files being deleted in these runtime state dirs, so allowing them to install anything in there at all doesn't make much sense. we should be careful though and ignore people who just create the basedir. i.e. ignore something like $D/var/lib/ existing but nothing underneath it. that'll let packages like baselayout work w/out triggering a QA warning, and it means that the package is already doing the right thing -- it just needs the dir to exist, but otherwise it'll take care of seeding content inside of the dir.
*** Bug 492432 has been marked as a duplicate of this bug. ***
thanks, that bug has more good reasons for supporting this
I'm not sure that /var/lib/ or /var/cache/ are the kinds of runtime state dir that should be included; unlike /run, /var/run, and /var/lock, information in /var/lib/ is supposed to be preserved indefinately, and some trees under /var/cache/ need to be pre-created so that unpriviliged processes can create/use files under them.
(In reply to Jonathan Callen from comment #3) yes & no. here's the FHS spec: http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLIBVARIABLESTATEINFORMATION "State information is generally used to preserve the condition of an application (or a group of inter-related applications) between invocations and between different instances of the same application. State information should generally remain valid after a reboot, should not be logging output, and should not be spooled data." http://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICATIONCACHEDATA "/var/cache is intended for cached data from applications. Such data is locally generated as a result of time-consuming I/O or calculation. The application must be able to regenerate or restore the data. Unlike /var/spool, the cached files can be deleted without data loss. The data must remain valid between invocations of the application and rebooting the system." that means if an app's data in there gets blown away, it needs to recover gracefully when possible. it might mean that the user needs to manually intervene (like when mysql/psql have their databases destroyed), but daemons should recover automatically the majority of the time. taken to the logical conclusion, packages should not be relying on the ebuild to initialize their dirs at install time. mysql/psql packages have a pkg_config func to take care of this (re-initialize databases), but most can do it in their init.d scripts with things like `checkpath`.
*** Bug 526386 has been marked as a duplicate of this bug. ***
Any progress for /var/lib now? I see TODO flags in install-qa-check.d/20runtime-directories . Should I avoid keepdir /var/lib/${PN} and doing that in init.d scripts or continue to use?
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=8ded447a1d194ad0190a174f7bb330417685d861 commit 8ded447a1d194ad0190a174f7bb330417685d861 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-04-10 16:51:02 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-04-10 17:19:57 +0000 install-qa-check.d/20runtime-directories: warn on /var/tmp too Bug: https://bugs.gentoo.org/493154 Bug: https://bugs.gentoo.org/837536 Signed-off-by: Sam James <sam@gentoo.org> bin/install-qa-check.d/20runtime-directories | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb044a3dd58f5d6ac0fa66dfe07daf3c6773480e commit bb044a3dd58f5d6ac0fa66dfe07daf3c6773480e Author: Sam James <sam@gentoo.org> AuthorDate: 2022-04-15 08:35:57 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-04-15 08:36:54 +0000 sys-apps/portage: backport new QA checks; /run warning removal portage.git is currently undergoing a fair bit of refactoring and other non-trivial changes, so let's backport some useful bits. - Backport QA checks (eend w/o ebegin, ebegin w/o eend, /var/tmp install dir) - Drop obsolete /run-not-mounted warning Bug: https://bugs.gentoo.org/835824 Bug: https://bugs.gentoo.org/835823 Bug: https://bugs.gentoo.org/832853 Bug: https://bugs.gentoo.org/493154 Bug: https://bugs.gentoo.org/837536 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/portage/files/3.0.30-qa-checks.patch | 137 ++++++++++ .../portage/files/3.0.30-revert-run-warn.patch | 64 +++++ sys-apps/portage/portage-3.0.30-r2.ebuild | 276 +++++++++++++++++++++ 3 files changed, 477 insertions(+)