Keep Snap fullnode/drone logs out of syslog, we're too spammy
This commit is contained in:
@ -2,6 +2,6 @@ FROM snapcraft/xenial-amd64
|
|||||||
|
|
||||||
# Update snapcraft to latest version
|
# Update snapcraft to latest version
|
||||||
RUN apt-get update -qq \
|
RUN apt-get update -qq \
|
||||||
&& apt-get install -y snapcraft \
|
&& apt-get install -y snapcraft daemontools \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& snapcraft --version
|
&& snapcraft --version
|
||||||
|
@ -37,6 +37,12 @@ fi
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
echo --- checking for multilog
|
||||||
|
if [[ ! -x /usr/bin/multilog ]]; then
|
||||||
|
echo "multilog not found, install with: sudo apt-get install -y daemontools"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo --- build
|
echo --- build
|
||||||
snapcraft
|
snapcraft
|
||||||
|
|
||||||
|
@ -10,6 +10,10 @@ if [[ -z $here ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
rsync=rsync
|
rsync=rsync
|
||||||
|
leader_logger="cat"
|
||||||
|
validator_logger="cat"
|
||||||
|
drone_logger="cat"
|
||||||
|
|
||||||
if [[ -d "$SNAP" ]]; then # Running inside a Linux Snap?
|
if [[ -d "$SNAP" ]]; then # Running inside a Linux Snap?
|
||||||
solana_program() {
|
solana_program() {
|
||||||
declare program="$1"
|
declare program="$1"
|
||||||
@ -22,6 +26,10 @@ if [[ -d "$SNAP" ]]; then # Running inside a Linux Snap?
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
rsync="$SNAP"/bin/rsync
|
rsync="$SNAP"/bin/rsync
|
||||||
|
leader_logger="$SNAP/bin/multilog t $SNAP_DATA/leader"
|
||||||
|
validator_logger="$SNAP/bin/multilog t $SNAP_DATA/validator"
|
||||||
|
drone_logger="$SNAP/bin/multilog t $SNAP_DATA/drone"
|
||||||
|
|
||||||
SOLANA_METRICS_CONFIG="$(snapctl get metrics-config)"
|
SOLANA_METRICS_CONFIG="$(snapctl get metrics-config)"
|
||||||
SOLANA_CUDA="$(snapctl get enable-cuda)"
|
SOLANA_CUDA="$(snapctl get enable-cuda)"
|
||||||
RUST_LOG="$(snapctl get rust-log)"
|
RUST_LOG="$(snapctl get rust-log)"
|
||||||
|
@ -36,6 +36,7 @@ set -ex
|
|||||||
mkdir -p "$SOLANA_CONFIG_DIR"
|
mkdir -p "$SOLANA_CONFIG_DIR"
|
||||||
$rsync -vPz "$rsync_leader_url"/config/leader.json "$SOLANA_CONFIG_DIR"/
|
$rsync -vPz "$rsync_leader_url"/config/leader.json "$SOLANA_CONFIG_DIR"/
|
||||||
|
|
||||||
# shellcheck disable=SC2086 # $solana_drone should not be quoted
|
set -o pipefail
|
||||||
exec $solana_drone \
|
$solana_drone \
|
||||||
-l "$SOLANA_CONFIG_DIR"/leader.json -k "$SOLANA_CONFIG_PRIVATE_DIR"/mint.json
|
-l "$SOLANA_CONFIG_DIR"/leader.json -k "$SOLANA_CONFIG_PRIVATE_DIR"/mint.json \
|
||||||
|
2>&1 | $drone_logger
|
||||||
|
@ -25,15 +25,8 @@ fi
|
|||||||
|
|
||||||
tune_networking
|
tune_networking
|
||||||
|
|
||||||
# migrate from old ledger format? why not...
|
set -xo pipefail
|
||||||
if [[ ! -f "$SOLANA_CONFIG_DIR"/ledger.log &&
|
$program \
|
||||||
-f "$SOLANA_CONFIG_DIR"/genesis.log ]]; then
|
|
||||||
(shopt -s nullglob &&
|
|
||||||
cat "$SOLANA_CONFIG_DIR"/genesis.log \
|
|
||||||
"$SOLANA_CONFIG_DIR"/tx-*.log) > "$SOLANA_CONFIG_DIR"/ledger.log
|
|
||||||
fi
|
|
||||||
|
|
||||||
# shellcheck disable=SC2086 # $program should not be quoted
|
|
||||||
exec $program \
|
|
||||||
--identity "$SOLANA_CONFIG_DIR"/leader.json \
|
--identity "$SOLANA_CONFIG_DIR"/leader.json \
|
||||||
--ledger "$SOLANA_CONFIG_DIR"/ledger.log
|
--ledger "$SOLANA_CONFIG_DIR"/ledger.log \
|
||||||
|
2>&1 | $leader_logger
|
||||||
|
@ -88,8 +88,9 @@ while ! $solana_wallet \
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
# shellcheck disable=SC2086 # $program should not be quoted
|
set -o pipefail
|
||||||
exec $program \
|
$program \
|
||||||
--identity "$SOLANA_CONFIG_DIR"/validator.json \
|
--identity "$SOLANA_CONFIG_DIR"/validator.json \
|
||||||
--testnet "$leader_address:$leader_port" \
|
--testnet "$leader_address:$leader_port" \
|
||||||
--ledger "$SOLANA_LEADER_CONFIG_DIR"/ledger.log
|
--ledger "$SOLANA_LEADER_CONFIG_DIR"/ledger.log \
|
||||||
|
2>&1 | $validator_logger
|
||||||
|
@ -110,8 +110,9 @@ parts:
|
|||||||
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
|
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
|
||||||
cp -av multinode-demo/* $SNAPCRAFT_PART_INSTALL/bin/
|
cp -av multinode-demo/* $SNAPCRAFT_PART_INSTALL/bin/
|
||||||
|
|
||||||
# TODO: build rsync from source instead of sneaking it in from the host
|
# TODO: build rsync/multilog from source instead of sneaking it in from the host
|
||||||
# system...
|
# system...
|
||||||
set -x
|
set -x
|
||||||
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
|
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
|
||||||
cp -av /usr/bin/rsync $SNAPCRAFT_PART_INSTALL/bin/
|
cp -av /usr/bin/rsync $SNAPCRAFT_PART_INSTALL/bin/
|
||||||
|
cp -av /usr/bin/multilog $SNAPCRAFT_PART_INSTALL/bin/
|
||||||
|
Reference in New Issue
Block a user