Commit 4fb98f98 authored by Ophélie Gagnard's avatar Ophélie Gagnard

dracut.module: Support SCAN_FILE macro.

parent d7b5c639
......@@ -5,17 +5,18 @@
source $NEWROOT/etc/rapid.space/get-network.sh
WENDELIN_REFERENCE=$(cat $NEWROOT/etc/rapid.space/wendelin_reference)
WENDELIN_USER=$(cat $NEWROOT/etc/rapid.space/wendelin_user)
sed -i "s/%WENDELIN_REFERENCE%/$WENDELIN_REFERENCE/g;s/%WENDELIN_USER%/$WENDELIN_USER/g" /etc/flb.conf
SCAN_FILE=/var/log/metadata_collect.log
sed -i "s/%SCAN_FILE%/$SCAN_FILE/g;s/%WENDELIN_REFERENCE%/$WENDELIN_REFERENCE/g;s/%WENDELIN_USER%/$WENDELIN_USER/g" /etc/flb.conf
log_file=/var/log/metadata_collect.log
SCAN_FILE=/var/log/metadata_collect.log
timestamp_cmd='date +"%Y/%m/%d %H:%M %Z"'
/sbin/fluent-bit -e /etc/libfluentbit_wendelin.so -c /etc/flb.conf &
flb_pid=$!
sleep 1 # let fluent-bit be ready to listen to the log file
echo "{\"beginning_date\": \"$(eval "$timestamp_cmd")\"}" >> $log_file
/sbin/metadata-collect-agent $NEWROOT/usr/bin $log_file
/sbin/metadata-collect-agent $NEWROOT/usr/sbin $log_file
echo "{\"end_date\": \"$(eval "$timestamp_cmd")\", \"end_marker\": \"fluentbit_end\"}" >> $log_file
echo "{\"beginning_date\": \"$(eval "$timestamp_cmd")\"}" >> $SCAN_FILE
/sbin/metadata-collect-agent $NEWROOT/usr/bin $SCAN_FILE
/sbin/metadata-collect-agent $NEWROOT/usr/sbin $SCAN_FILE
echo "{\"end_date\": \"$(eval "$timestamp_cmd")\", \"end_marker\": \"fluentbit_end\"}" >> $SCAN_FILE
wait $flb_pid
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment