Revert "emmc_log: Add rsyslog state to eMMC"
This reverts commit 758ed2887ef25b1b8707320f73b6688e0d028a11.
Reason for revert: The persistent state will save the real time and be used during next boot and filter out all early boot logs. All logs before timesync will be removed.
Tested: N/A
Fusion-Link: fusion2 N/A
Google-Bug-Id: 336291769
Change-Id: I54355e374e9b6d7b21994069637a627bf2a319a8
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/recipes-google/emmc/emmc-logs/start_emmc_logging.sh b/recipes-google/emmc/emmc-logs/start_emmc_logging.sh
index 115fd90..add7116 100644
--- a/recipes-google/emmc/emmc-logs/start_emmc_logging.sh
+++ b/recipes-google/emmc/emmc-logs/start_emmc_logging.sh
@@ -3,7 +3,6 @@
EMMC_DIR=/mnt/luks-mmcblk0_fs
LOG_SUBDIR=logs
EMMC_LOG_DIR="$EMMC_DIR/$LOG_SUBDIR"
-EMMC_LOG_STATE_DIR="$EMMC_LOG_DIR/state"
EmmcMountCount=$(mount -l | grep -c "$EMMC_DIR")
if [ "$EmmcMountCount" -ne 1 ]
@@ -11,11 +10,8 @@
echo "eMMC is not mounted. Cannot log to eMMC."
exit 1
fi
-mkdir -p "$EMMC_LOG_DIR"
-mkdir -p "$EMMC_LOG_STATE_DIR"
-echo "Stop rsyslog before migrating to eMMC to make sure we don't send out logs during transition"
-systemctl stop rsyslog.service
+mkdir -p "$EMMC_LOG_DIR"
# We need to make room for incoming logs, or else systemd will just
# throw away the runtime journal. Ensure these values are in sync with
@@ -40,13 +36,9 @@
done
ln -s "$EMMC_LOG_DIR" /var/log/journal
-rm -rf /var/log/state
-ln -s "$EMMC_LOG_STATE_DIR" /var/log/state
echo "Flushing journal logs to eMMC"
journalctl --flush
echo "Journald is now logging to eMMC"
-systemctl restart rsyslog.service
-echo "Restarted Rsyslog to make sure it reload the state"
diff --git a/recipes-google/emmc/emmc-logs/stop_emmc_logging.sh b/recipes-google/emmc/emmc-logs/stop_emmc_logging.sh
index f17c517..7f34959 100644
--- a/recipes-google/emmc/emmc-logs/stop_emmc_logging.sh
+++ b/recipes-google/emmc/emmc-logs/stop_emmc_logging.sh
@@ -11,7 +11,6 @@
# Remove the symlink to the eMMC log directory.
rm /var/log/journal
-rm -rf /var/log/state
# Restart rsyslog to make sure it closes the log files in the eMMC.
# 90 seconds after sigterm is send sig kill is sent