mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
* Work around a race condition starting the Nix daemon.
This commit is contained in:
parent
5193db048e
commit
7d314b8c95
1 changed files with 8 additions and 1 deletions
|
@ -32,7 +32,7 @@ export REAL_DATA_DIR=@datadir@
|
||||||
export REAL_STORE_DIR=@storedir@
|
export REAL_STORE_DIR=@storedir@
|
||||||
export NIX_BUILD_HOOK=
|
export NIX_BUILD_HOOK=
|
||||||
export PERL=perl
|
export PERL=perl
|
||||||
export PERL5LIB=$TOP/perl/lib
|
export PERL5LIB=$TOP/perl/lib:$PERL5LIB
|
||||||
export NIX_BZIP2="@bzip2_bin_test@/bzip2"
|
export NIX_BZIP2="@bzip2_bin_test@/bzip2"
|
||||||
if test "${NIX_BZIP2:0:1}" != "/"; then
|
if test "${NIX_BZIP2:0:1}" != "/"; then
|
||||||
NIX_BZIP2=`pwd`/${NIX_BZIP2}
|
NIX_BZIP2=`pwd`/${NIX_BZIP2}
|
||||||
|
@ -74,7 +74,14 @@ clearManifests() {
|
||||||
}
|
}
|
||||||
|
|
||||||
startDaemon() {
|
startDaemon() {
|
||||||
|
# Start the daemon, wait for the socket to appear. !!!
|
||||||
|
# ‘nix-worker’ should have an option to fork into the background.
|
||||||
|
rm -f $NIX_STATE_DIR/daemon-socket/socket
|
||||||
nix-worker --daemon &
|
nix-worker --daemon &
|
||||||
|
for ((i = 0; i < 30; i++)); do
|
||||||
|
if [ -e $NIX_STATE_DIR/daemon-socket/socket ]; then break; fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
pidDaemon=$!
|
pidDaemon=$!
|
||||||
trap "kill -9 $pidDaemon" EXIT
|
trap "kill -9 $pidDaemon" EXIT
|
||||||
export NIX_REMOTE=daemon
|
export NIX_REMOTE=daemon
|
||||||
|
|
Loading…
Reference in a new issue