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

dracut.module/: Add a debug mode in initramfs.

parent ac49a7d0
......@@ -5,16 +5,25 @@
#>&2 echo "$NEWROOT" # DEBUG: display the path of newroot before the pivot
#sleep 10 # DEBUG
DEBUG_LOG_FILE=/var/log/debug-mode.log
MCA_LOG_FILE=/var/log/metadata_collect.log
echo "********** /sbin **********" >> $MCA_LOG_FILE
ls -Rl /sbin >> $MCA_LOG_FILE
echo "********** /bin **********" >> $MCA_LOG_FILE
#ls -Rl /bin >> $MCA_LOG_FILE
echo "********** /etc **********" >> $MCA_LOG_FILE
ls -Rl /etc >> $MCA_LOG_FILE
echo "********** /lib **********" >> $MCA_LOG_FILE
#ls -Rl /lib >> $MCA_LOG_FILE
/sbin/fluent-bit -e /etc/libfluentbit_wendelin.so -c /etc/debug-mode.conf &
debug_flb_pid=$!
sleep 1 # wait for fluent-bit to monitor the log file (?)
echo "NEWROOT = $NEWROOT" &>> $DEBUG_LOG_FILE
echo "********** /sbin **********" &>> $DEBUG_LOG_FILE
ls -Rl /sbin &>> $DEBUG_LOG_FILE
echo "********** /bin **********" &>> $DEBUG_LOG_FILE
ls -Rl /bin &>> $DEBUG_LOG_FILE
echo "********** /etc **********" &>> $DEBUG_LOG_FILE
ls -Rl /etc &>> $DEBUG_LOG_FILE
echo "********** /lib **********" &>> $DEBUG_LOG_FILE
ls -Rl /lib &>> $DEBUG_LOG_FILE
echo "fluentbit_end" &>> $DEBUG_LOG_FILE
wait $debug_flb_pid
#/sbin/metadata-collect-agent "$NEWROOT"
/sbin/metadata-collect-agent $NEWROOT /sbin/fluent-bit /etc/libfluentbit_wendelin.so /etc/flb.conf /var/log/metadata_collect.log
......
[SERVICE]
flush 5
[INPUT]
name tail
path /var/log/debug-mode.log
tag DEBUG
[output]
name fluentbit_wendelin
match *
streamtool_uri https://softinst157546.host.vifib.net/erp5/portal_ingestion_policies/metadata_upload
user zope
password qxrfkwod
buffer_type memory
flush_interval 60s
disable_retry_limit true
reference c-light-data_05
#!/bin/bash
check() {
require_binaries grep head ip ls || return 1
require_binaries grep head ip ls sleep || return 1
return 255
}
......@@ -10,10 +10,11 @@ depends() {
}
install() {
inst_multiple head ip grep ls
inst_multiple head ip grep ls sleep
inst "$moddir"/metadata-collect-agent "/sbin/metadata-collect-agent"
inst "$moddir"/fluent-bit "/sbin/fluent-bit"
inst "$moddir"/flb.conf "/etc/flb.conf"
inst "$moddir"/libfluentbit_wendelin.so "/etc/libfluentbit_wendelin.so"
inst "$moddir"/flb.conf "/etc/flb.conf"
inst "$moddir"/debug-mode.conf "/etc/debug-mode.conf"
inst_hook pre-pivot 10 "$moddir"/collect.sh
}
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