Brian Picciano
8c3e6a2845
In a world where the daemon can manage more than one network, the Daemon is really responsible only for knowing which networks are currently joined, creating/joining/leaving networks, and routing incoming RPC requests to the correct network handler as needed. The new network package, with its Network interface, inherits most of the logic that Daemon used to have, leaving Daemon only the parts needed for the functionality just described. There's a lot of cleanup done here in order to really nail down the separation of concerns between the two, especially around directory creation.
19 lines
444 B
Bash
19 lines
444 B
Bash
set -e
|
|
|
|
base="$1"
|
|
|
|
TMPDIR="$ROOT_TMPDIR/$base"
|
|
XDG_RUNTIME_DIR="$TMPDIR/.run"
|
|
XDG_STATE_HOME="$TMPDIR/.state"
|
|
|
|
mkdir -p "$TMPDIR" "$XDG_RUNTIME_DIR" "$XDG_STATE_HOME"
|
|
|
|
cat <<EOF
|
|
export TMPDIR="$TMPDIR"
|
|
export XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR"
|
|
export XDG_STATE_HOME="$XDG_STATE_HOME"
|
|
export ISLE_DAEMON_HTTP_SOCKET_PATH="$ROOT_TMPDIR/$base-daemon.sock"
|
|
BOOTSTRAP_FILE="$XDG_STATE_HOME/isle/networks/$NETWORK_ID/bootstrap.json"
|
|
cd "$TMPDIR"
|
|
EOF
|