-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix onie discover stopped while console XOFF is triggered #386
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
# Copyright (C) 2016 Audi Hsu <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
## | ||
## redirect console_log_file and tee_log_file to /dev/console | ||
## | ||
|
||
. /lib/onie/functions | ||
|
||
touch $console_log_file && /usr/bin/tail -f $console_log_file > /dev/console & | ||
touch $tee_log_file && /usr/bin/tail -f $tee_log_file > /dev/console & |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../init.d/console-logger.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,9 @@ export onie_installer="/var/tmp/installer" | |
|
||
ONIE_RUN_DIR="/var/run/onie" | ||
|
||
tee_log_file=/dev/console | ||
tee_log_file="/var/log/onie-tee.log" | ||
console_log_file="/var/log/onie-console.log" | ||
|
||
if [ "$onie_boot_reason" = "update" -o "$onie_boot_reason" = "embed" ] ; then | ||
filename_prefix="onie-updater" | ||
onie_operation="onie-update" | ||
|
@@ -44,33 +46,33 @@ syslog_tag="onie" | |
|
||
_log_msg() | ||
{ | ||
printf "$@" | tee $tee_log_file | logger -t $syslog_tag -p ${syslog_onie}.info | ||
printf "$@" | tee -a $tee_log_file | logger -t $syslog_tag -p ${syslog_onie}.info | ||
} | ||
|
||
_log_console_msg() | ||
{ | ||
printf "$@" | tee /dev/console | logger -t $syslog_tag -p ${syslog_onie}.info | ||
printf "$@" | tee -a $console_log_file | logger -t $syslog_tag -p ${syslog_onie}.info | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems we could just use Thinking a bit about names. The name |
||
} | ||
|
||
_log_info_msg() | ||
{ | ||
printf "$@" | tee $tee_log_file | logger -t $syslog_tag -p ${syslog_onie}.info | ||
printf "$@" | tee -a $tee_log_file | logger -t $syslog_tag -p ${syslog_onie}.info | ||
} | ||
|
||
_log_warn_msg() | ||
{ | ||
printf "$@" | tee $tee_log_file | logger -t ${syslog_tag}-warn -p ${syslog_onie}.warn | ||
printf "$@" | tee -a $tee_log_file | logger -t ${syslog_tag}-warn -p ${syslog_onie}.warn | ||
} | ||
|
||
_log_err_msg() | ||
{ | ||
printf "$@" | tee $tee_log_file | logger -t ${syslog_tag}-error -p ${syslog_onie}.err | ||
printf "$@" | tee -a $tee_log_file | logger -t ${syslog_tag}-error -p ${syslog_onie}.err | ||
} | ||
|
||
log_debug_msg() | ||
{ | ||
if [ "$onie_verbose" = "y" ]; then | ||
printf "$@" | tee $tee_log_file | logger -t ${syslog_tag}-debug -p ${syslog_onie}.debug | ||
printf "$@" | tee -a $tee_log_file | logger -t ${syslog_tag}-debug -p ${syslog_onie}.debug | ||
fi | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking for this whole patch, it seems we can simplify it a little bit.
Do we really need both
$console_log_file
and$tee_log_file
?It seems we only need
$tee_log_file
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there are _log_console_msg and other different log message levels, I shall keep the console_log_file and tee_log_file.
Unless the logging message definition is changed.