Darryl L. Pierce
2009-Jun-16 16:25 UTC
[Ovirt-devel] [PATCH node] Adds a log viewer option to o-c-setup. bz#506289
A new menu option to view the file /var/log/ovirt.log is added. If the file doesn't exist or is 0 bytes then a message saying the log is empty is shown. Otherwise, it's displayed using the less command. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- scripts/ovirt-config-setup | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-config-setup b/scripts/ovirt-config-setup index ee78254..11711e1 100755 --- a/scripts/ovirt-config-setup +++ b/scripts/ovirt-config-setup @@ -11,6 +11,8 @@ CONFIG_DIR=/etc/ovirt-config-setup.d # special options, all others execute the symlinked script in CONFIG_DIR DEBUG_SHELL="Shell" CONTINUE="Continue Stateless Boot" +VIEW_LOG="View ovirt.log" +OVIRT_LOG=/var/log/ovirt.log declare -a OPTIONS @@ -33,6 +35,7 @@ for cfg in $CONFIG_DIR/*; do done OPTIONS[${#OPTIONS[*]}]="$DEBUG_SHELL" OPTIONS[${#OPTIONS[*]}]="$CONTINUE" +OPTIONS[${#OPTIONS[*]}]="$VIEW_LOG" # reset tty, otherwise serial console is broken @@ -51,6 +54,14 @@ while true; do case "$OPTION" in "$DEBUG_SHELL") clear; bash; break ;; "$CONTINUE") exit 0 ;; + "$VIEW_LOG") + if [ -s $OVIRT_LOG ]; then + clear + less -R $OVIRT_LOG + else + printf "\nThe log is currently empty.\n\n" + fi + ;; "") break ;; *) { -- 1.6.0.6
Perry Myers
2009-Jun-16 16:30 UTC
[Ovirt-devel] [PATCH node] Adds a log viewer option to o-c-setup. bz#506289
On 06/16/2009 12:25 PM, Darryl L. Pierce wrote:> A new menu option to view the file /var/log/ovirt.log is added. If the > file doesn't exist or is 0 bytes then a message saying the log is empty > is shown. Otherwise, it's displayed using the less command.Hmm, we want to be able to view other logs easily too. Like /var/log/messages and /var/log/secure for starters. Perhaps this patch should be extended to be easily configurable to display an arbitrary number of log files? Perry
Maybe Matching Threads
- [PATCH node] Changes the exit/continue based on context.
- [PATCH node] Changes the exit prompt based on whether it's firstboot of cmdline.
- [PATCH node] Users can view log files on the node. bz#506289
- [PATCH node] Adds vlan support to auto-installations for the node. bz#511056
- Printing on a Window Client from AIX