commit:     b276da8ae379f7eb0dcb9e9020bb37035db3376c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 30 18:54:33 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jan  1 10:34:44 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b276da8a

tmpfiles.eclass: Explicit warn on ROOT != / to avoid breakage

Closes: https://github.com/gentoo/gentoo/pull/4526

 eclass/tmpfiles.eclass | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/eclass/tmpfiles.eclass b/eclass/tmpfiles.eclass
index 49c3cba6bdd..6a461d4df85 100644
--- a/eclass/tmpfiles.eclass
+++ b/eclass/tmpfiles.eclass
@@ -110,7 +110,18 @@ tmpfiles_process() {
        [[ ${#} -gt 0 ]] || die "${FUNCNAME}: Must specify at least one 
filename"
 
        # Only process tmpfiles for the currently running system
-       [[ ${ROOT} == / ]] || return 0
+       if [[ ${ROOT} != / ]]; then
+               ewarn "Warning: tmpfiles.d not processed on ROOT != /. If you 
do not use"
+               ewarn "a service manager supporting tmpfiles.d, you need to run"
+               ewarn "the following command after booting (or chroot-ing with 
all"
+               ewarn "appropriate filesystems mounted) into the ROOT:"
+               ewarn
+               ewarn "  tmpfiles --create"
+               ewarn
+               ewarn "Failure to do so may result in missing runtime 
directories"
+               ewarn "and failures to run programs or start services."
+               return
+       fi
 
        if type systemd-tmpfiles &> /dev/null; then
                systemd-tmpfiles --create "$@"

Reply via email to