Call commonChildInit() before doing chroot init
This ensures that daemon clients see error messages from the chroot setup.
This commit is contained in:
parent
eea0401d7a
commit
4c4b219c07
2 changed files with 16 additions and 12 deletions
|
@ -374,8 +374,6 @@ void Goal::trace(const format & f)
|
|||
/* Common initialisation performed in child processes. */
|
||||
static void commonChildInit(Pipe & logPipe)
|
||||
{
|
||||
restoreAffinity();
|
||||
|
||||
/* Put the child in a separate session (and thus a separate
|
||||
process group) so that it has no controlling terminal (meaning
|
||||
that e.g. ssh cannot open /dev/tty) and it doesn't receive
|
||||
|
@ -1962,6 +1960,12 @@ void DerivationGoal::initChild()
|
|||
|
||||
try { /* child */
|
||||
|
||||
_writeToStderr = 0;
|
||||
|
||||
restoreAffinity();
|
||||
|
||||
commonChildInit(builderOut);
|
||||
|
||||
#if CHROOT_ENABLED
|
||||
if (useChroot) {
|
||||
/* Initialise the loopback interface. */
|
||||
|
@ -2080,8 +2084,6 @@ void DerivationGoal::initChild()
|
|||
}
|
||||
#endif
|
||||
|
||||
commonChildInit(builderOut);
|
||||
|
||||
if (chdir(tmpDir.c_str()) == -1)
|
||||
throw SysError(format("changing into `%1%'") % tmpDir);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue