Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 740586

Summary: systemd.eclass: systemd_tmpfiles_create does not call `systemd-tmpfiles --create`
Product: Gentoo Linux Reporter: Adrian <adrian>
Component: EclassesAssignee: Gentoo systemd Team <systemd>
Status: RESOLVED FIXED    
Severity: normal CC: adrian, mgorny, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=740638
Whiteboard:
Package list:
Runtime testing required: ---

Description Adrian 2020-09-06 00:06:45 UTC
I noticed that when installing postgresql, /run/postgresql (on a systemd-based system) was not created.

The tmpfiles.d entry /usr/lib/tmpfiles.d/postgresql-12.conf got created just fine, but the systemd_tmpfiles_create function aborted when checking $ROOT in [1].

Looking at the example code in [2] which implies an empty $ROOT (otherwise the code there would output two leading slashes!) and the code a bit below [3], I think the check should be `[[ ${ROOT:-/} == / ]]` instead of `[[ ${ROOT} == / ]]` (when changing it manually everything works fine).

[1]: https://github.com/gentoo/gentoo/blob/5076a5d39849249f0ddc424bf5e36b69aa167892/eclass/systemd.eclass#L451
[2]: https://devmanual.gentoo.org/ebuild-writing/variables/index.html#root
[3]: https://github.com/gentoo/gentoo/blob/5076a5d39849249f0ddc424bf5e36b69aa167892/eclass/systemd.eclass#L471-L472
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-09-06 03:19:16 UTC
These functions should have been removed a long time ago.  Today you're supposed to use tmpfiles.eclass.
Comment 2 Larry the Git Cow gentoo-dev 2020-09-09 14:45:55 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ca6f4764d3c2d826a52152a71a7dcdf66d120df

commit 4ca6f4764d3c2d826a52152a71a7dcdf66d120df
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-09-06 13:55:18 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-09-09 14:44:38 +0000

    systemd.eclass: fix systemd_tmpfiles_create under EAPI 7
    
    Closes: https://bugs.gentoo.org/740586
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/systemd.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)