#3531 Issue closed: TMPDIR related inquiry¶
Labels: support / question, fixed / solved / done
Kinann01 opened issue at 2025-10-30 10:03:¶
Requesting support or just a question¶
Question regarding TMPDIR value during initramfs and early stage booting in the rescue image
Platform¶
Linux PPC64LE
Output¶
-> rear --version
Relax-and-Recover 2.7 / 2022-07-13
Additional information¶
Beginner level knowledge of ReaR here. I would like to understand a few
things and if I can be pointed to source code that would be great. What
is the value of TMPDIR supposed to be during early stage booting in
the rescued image? Suppose TMPDIR is exported to a user defined
directory prior to performing rear mkrescue/mkbackup to set up the
build area. The rescue image is built successfully but once booting into
it, it seems that the value of TMPDIR at an early stage remains to the
one set on the host. The skel/default/* will not include that
directory. Is something triggering the migration of TMPDIR to the
rescued image? Should TMPDIR be reset to default /tmp? or should the
user defined directory be included in the skel? The inquiry arises as
mktemp fails during the network migration script in system-setup.d/.
Assume no export of TMPDIR is done in any *.conf files.
pcahyna commented at 2025-10-30 10:29:¶
The rescue image is built successfully but once booting into it, it seems that the value of TMPDIR at an early stage remains to the one set on the host.
That sounds weird. Are you saying that if you set TMPDIR to a
nonstandard /a/b/c value before mkbackup, then the rescue image
boots with TMPDIR=/a/b/c? This is certainly not expected.
Suppose TMPDIR is exported to a user defined directory prior to performing rear mkrescue/mkbackup to set up the build area.
How do you set TMPDIR to the user-defined value? Aren't you setting it
in the ReaR configuration file?
Kinann01 commented at 2025-11-01 18:26:¶
[...]
How do you setTMPDIRto the user-defined value? Aren't you setting it in the ReaR configuration file?
ah, I was operating under the assumption that TMPDIR is set prior to
calling rear on the host which is where the confusion came from when
mktemp failed, during booting in the rescue image, reporting that the
directory does not exist. It was a misunderstanding and turns out it was
exported in a user rear config file. We have correctly exported
TMPDIR. Apologies for the noise and TY for the support. Closing with
comment.
pcahyna commented at 2025-11-03 10:55:¶
@Kinann01 setting TMPDIR in the config file used to be supported, but it is not anymore ( see b422845f14ea59c8b8dd16449df217334569faa7 and #2654 ), so you should set it in the environment before executing the program (like with any other program that respects TMPDIR).
[Export of Github issue for rear/rear.]