Skip to content

Commit

Permalink
wemix/scripts/gwemix.sh: Added log file size and count settings using…
Browse files Browse the repository at this point in the history
… .rc files.
  • Loading branch information
cp-wjhan committed Dec 6, 2023
1 parent 5919efa commit d611c11
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wemix/scripts/gwemix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,16 @@ function start ()
[ "$MAX_TXS_PER_BLOCK" = "" ] || OPTS="${OPTS} --maxtxsperblock ${MAX_TXS_PER_BLOCK}"

[ -d "$d/logs" ] || mkdir -p $d/logs
[ "$LOG_FILESIZE" = "" ] && LOG_FILESIZE="10M"
[ "$LOG_FILECOUNT" = "" ] && LOG_FILECOUNT="5"

cd $d
if [ ! "$2" = "inner" ]; then
$GWEMIX --datadir ${PWD} --metrics $OPTS 2>&1 | \
${d}/bin/logrot ${d}/logs/log 10M 5 &
${d}/bin/logrot ${d}/logs/log ${LOG_FILESIZE} ${LOG_FILECOUNT} &
else
if [ -x "$d/bin/logrot" ]; then
exec > >($d/bin/logrot $d/logs/log 10M 5)
exec > >($d/bin/logrot $d/logs/log ${LOG_FILESIZE} ${LOG_FILECOUNT})
exec 2>&1
fi
exec $GWEMIX --datadir ${PWD} --metrics $OPTS
Expand Down

0 comments on commit d611c11

Please sign in to comment.