I was trying to narrow down what was causing a 1-2 min delay in the U2F key cueing me for touch after entering a password via GDM. The lack of timestamps on the debug logs did not help as I could not discount pam-u2f as the cause until I setup some monitoring to confirm pam-u2f was not causing the delay.
Describe the solution that you'd like
Timestamp the debug logs set via PAM config.
Describe the alternatives that you've considered
$ cat ~/.bin/timestamp_logs.sh
#!/bin/bash
LOGFILE="/var/log/pam_u2f_gdm.log"
TIMESTAMPED_LOGFILE="/var/log/timestamped_pam_u2f_gdm.log"
# Ensure the timestamped log file exists
touch "$TIMESTAMPED_LOGFILE"
# Function to append new lines with timestamps
append_with_timestamp() {
while read -r line; do
echo "$(date +"%Y-%m-%d %H:%M:%S") $line" >> "$TIMESTAMPED_LOGFILE"
done
}
# Monitor the log file for new lines
tail -n0 -F "$LOGFILE" | append_with_timestamp &
Is your feature request related to a problem?
Sorta, see https://github.com/Yubico/pam-u2f/issues/310
I was trying to narrow down what was causing a 1-2 min delay in the U2F key cueing me for touch after entering a password via GDM. The lack of timestamps on the debug logs did not help as I could not discount
pam-u2f
as the cause until I setup some monitoring to confirmpam-u2f
was not causing the delay.Describe the solution that you'd like
Timestamp the debug logs set via PAM config.
Describe the alternatives that you've considered