Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 2/3] tmpfiles.eclass: Explicit warn on ROOT != / to avoid breakage
Date: Sun, 30 Apr 2017 19:08:00
Message-Id: 20170430190655.9946-2-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/3] tmpfiles.eclass: Support using on non-Linux systems by "Michał Górny"
1 ---
2 eclass/tmpfiles.eclass | 13 ++++++++++++-
3 1 file changed, 12 insertions(+), 1 deletion(-)
4
5 diff --git a/eclass/tmpfiles.eclass b/eclass/tmpfiles.eclass
6 index 9cf040de987f..018ea45d4182 100644
7 --- a/eclass/tmpfiles.eclass
8 +++ b/eclass/tmpfiles.eclass
9 @@ -110,7 +110,18 @@ tmpfiles_process() {
10 [[ ${#} -gt 0 ]] || die "${FUNCNAME}: Must specify at least one filename"
11
12 # Only process tmpfiles for the currently running system
13 - [[ ${ROOT} == / ]] || return 0
14 + if [[ ${ROOT} != / ]]; then
15 + ewarn "Warning: tmpfiles.d not processed on ROOT != /. If you do not use"
16 + ewarn "a service manager supporting tmpfiles.d, you need to run"
17 + ewarn "the following command after booting (or chroot-ing with all"
18 + ewarn "appropriate filesystems mounted) into the ROOT:"
19 + ewarn
20 + ewarn " tmpfiles --create"
21 + ewarn
22 + ewarn "Failure to do so may result in missing runtime directories"
23 + ewarn "and failures to run programs or start services."
24 + return
25 + fi
26
27 if type systemd-tmpfiles &> /dev/null; then
28 systemd-tmpfiles --create "$@"
29 --
30 2.13.0.rc1