tmpfiles.eclass: Explicit warn on ROOT != / to avoid breakage
authorMichał Górny <mgorny@gentoo.org>
Sun, 30 Apr 2017 18:54:33 +0000 (20:54 +0200)
committerMichał Górny <mgorny@gentoo.org>
Mon, 1 Jan 2018 10:34:44 +0000 (11:34 +0100)
Closes: https://github.com/gentoo/gentoo/pull/4526

eclass/tmpfiles.eclass

index 49c3cba6bdd272219e56201cd8f0532c813c2dcf..6a461d4df859cc104e5afdf0a1daa86d7dfe7372 100644 (file)
@@ -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 "$@"