Darryl L. Pierce
2009-Jun-18 13:56 UTC
[Ovirt-devel] [PATCH node] Users can view log files on the node. bz#506289
Adds a new menu item which launches a separate script. That separate script presents a list of log files to the user. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- Makefile.am | 1 + ovirt-node.spec.in | 3 +++ scripts/ovirt-config-view-logs | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 0 deletions(-) create mode 100755 scripts/ovirt-config-view-logs diff --git a/Makefile.am b/Makefile.am index 57eceb5..2f52144 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,6 +40,7 @@ EXTRA_DIST = \ scripts/ovirt-config-setup \ scripts/ovirt-config-storage \ scripts/ovirt-config-uninstall \ + scripts/ovirt-config-view-logs \ scripts/ovirt-early \ scripts/ovirt-firstboot \ scripts/ovirt-functions \ diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in index e5d1d51..6fa45ce 100644 --- a/ovirt-node.spec.in +++ b/ovirt-node.spec.in @@ -159,6 +159,7 @@ cd - %{__install} -D -m0755 scripts/ovirt-install-node-stateful %{buildroot}%{_sbindir} %{__install} -D -m0755 scripts/ovirt-install-node-stateless %{buildroot}%{_sbindir} %{__install} -D -m0755 scripts/ovirt-uninstall-node-stateful %{buildroot}%{_sbindir} +%{__install} -D -m0755 scripts/ovirt-config-view-logs %{buildroot}%{_sbindir} %{__install} -p -m0755 scripts/persist %{buildroot}%{_sbindir} %{__install} -p -m0755 scripts/unpersist %{buildroot}%{_sbindir} %{__install} -p -m0755 ovirt-identify-node/ovirt-identify-node %{buildroot}%{_sbindir} @@ -227,6 +228,7 @@ ln -s ovirt-release %{buildroot}/etc/system-release %{__ln_s} ../..%{_sbindir}/ovirt-config-networking %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"15_Networking Setup" %{__ln_s} ../..%{_sbindir}/ovirt-config-logging %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"30_Logging Setup" %{__ln_s} ../..%{_sbindir}/ovirt-config-collectd %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"35_Collectd Setup" +%{__ln_s} ../..%{_sbindir}/ovirt-config-view-logs %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"90_View logs" %{__ln_s} ../..%{_sbindir}/ovirt-config-boot-wrapper %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"98_Local install and reboot" %{__ln_s} ../..%{_sbindir}/ovirt-config-uninstall %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"99_Uninstall node" @@ -311,6 +313,7 @@ fi %{_sbindir}/ovirt-config-setup %{_sbindir}/ovirt-config-storage %{_sbindir}/ovirt-config-uninstall +%{_sbindir}/ovirt-config-view-logs %{_sbindir}/ovirt-process-config %{_sbindir}/ovirt-install-node-stateless %{_sbindir}/gptsync diff --git a/scripts/ovirt-config-view-logs b/scripts/ovirt-config-view-logs new file mode 100755 index 0000000..f21b462 --- /dev/null +++ b/scripts/ovirt-config-view-logs @@ -0,0 +1,37 @@ +#!/bin/bash +# + +. /etc/init.d/ovirt-functions + +ME=$(basename "$0") +warn() { printf '%s: %s\n' "$ME" "$*" >&2; } +die() { warn "$*"; exit 1; } + +trap '__st=$?; stop_log; exit $__st' 0 +trap 'exit $?' 1 2 13 15 + +RETURN_TO_MENU="Return To Menu" + +OPTIONS[${#OPTIONS[*]}]="/var/log/ovirt.log" +OPTIONS[${#OPTIONS[*]}]="$RETURN_TO_MENU" + +while true; do + printf "\nPlease select a log file to view.\n\n" + PS3="Please select a log to view: " + select OPTION in "${OPTIONS[@]}" + do + case $OPTION in + "$RETURN_TO_MENU") exit 0;; + "") break;; + *) + if [ -s "$OPTION" ]; then + clear + less -R "$OPTION" + printf "\n\n" + else + printf "$OPTION is empty\n\n" + fi + ;; + esac + done +done -- 1.6.0.6
Alan Pevec
2009-Jul-09 11:20 UTC
[Ovirt-devel] Re: [PATCH node] Users can view log files on the node. bz#506289
Darryl L. Pierce wrote:> Adds a new menu item which launches a separate script. That separate > script presents a list of log files to the user.ack, just> +OPTIONS[${#OPTIONS[*]}]="/var/log/ovirt.log"add more log files to the menu, /var/log/messages at least...> +OPTIONS[${#OPTIONS[*]}]="$RETURN_TO_MENU"
Apparently Analagous Threads
- [PATCH node] Disables SSH by default, and allows for enabling at firstboot. rhbz#509842
- [PATCH node] Add iSCSI initiator setup option
- [PATCH ovirt-node] Removed subpackages, stateful, stateless, logos, and selinux for inclusuion in Fedora
- [PATCH server] oVirt server single network installer
- [PATCH] move dracut config and patching to spec