[Ovirt-devel] Re: [PATCH] Redirecting all logs to /var/log/ovirt.log

Perry N. Myers pmyers at redhat.com
Mon Jul 14 15:40:23 UTC 2008


Darryl L. Pierce wrote:
> Can I get some feedback or an ACK on this patch, please?

Sorry for the delay...

Two comments about this...

The redirects just do stdout.  Probably want >> $OVIRT_LOGFILE 2>&1 to get 
stderr as well.

And this brings up a cosmetic question...  By putting the redirects where 
you have them, we don't get the pretty [ OK ] things popping up on boot.

Should be able to do that by redirecting output from things like
echo -n "Starting ovirt: "
and
success

to another fd that eventually goes to stdout.

Perry

> Darryl L. Pierce wrote:
>> From: Darryl Pierce <dpierce at redhat.com>
>>
>>
>> Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
>> ---
>>  ovirt-managed-node/src/scripts/ovirt           |   21 
>> ++++++++++++---------
>>  ovirt-managed-node/src/scripts/ovirt-awake     |    2 +-
>>  ovirt-managed-node/src/scripts/ovirt-early     |   20 
>> +++++++++++---------
>>  ovirt-managed-node/src/scripts/ovirt-functions |    5 ++++-
>>  ovirt-managed-node/src/scripts/ovirt-post      |   18 ++++++++++--------
>>  5 files changed, 38 insertions(+), 28 deletions(-)
>>
>> diff --git a/ovirt-managed-node/src/scripts/ovirt 
>> b/ovirt-managed-node/src/scripts/ovirt
>> index 92a0e40..644675b 100755
>> --- a/ovirt-managed-node/src/scripts/ovirt
>> +++ b/ovirt-managed-node/src/scripts/ovirt
>> @@ -18,7 +18,8 @@ start() {
>>      if [ ! -s $krb5_conf ]; then
>>          rm -f $krb5_conf
>>          # FIXME this is IPA specific
>> -        wget -q http://$SRV_HOST:$SRV_PORT/ipa/config/krb5.ini -O 
>> $krb5_conf \
>> +        wget -q \
>> +            http://$SRV_HOST:$SRV_PORT/ipa/config/krb5.ini -O 
>> $krb5_conf \
>>              || die "Failed to get $krb5_conf"
>>      fi
>>      IPA_HOST=$SRV_HOST
>> @@ -41,11 +42,13 @@ start() {
>>      echo
>>  }
>>  
>> -case "$1" in
>> -    start)
>> -        start
>> -        ;;
>> -    *)
>> -        echo "Usage: ovirt {start}"
>> -        exit 2
>> -esac
>> +{
>> +    case "$1" in
>> +        start)
>> +            start
>> +            ;;
>> +        *)
>> +            echo "Usage: ovirt {start}"
>> +            exit 2
>> +    esac
>> +} >> $OVIRT_LOGFILE
>> diff --git a/ovirt-managed-node/src/scripts/ovirt-awake 
>> b/ovirt-managed-node/src/scripts/ovirt-awake
>> index 4e43d45..38d405e 100755
>> --- a/ovirt-managed-node/src/scripts/ovirt-awake
>> +++ b/ovirt-managed-node/src/scripts/ovirt-awake
>> @@ -66,7 +66,7 @@ start () {
>>              if [ -n $KEYTAB ]; then
>>                  echo "Retrieving keytab: '$KEYTAB'"
>>  
>> -                wget $KEYTAB --output-document=$KEYTAB_FILE
>> +                wget -q $KEYTAB --output-document=$KEYTAB_FILE
>>              else
>>                  echo "No keytab to retrieve"
>>              fi
>> diff --git a/ovirt-managed-node/src/scripts/ovirt-early 
>> b/ovirt-managed-node/src/scripts/ovirt-early
>> index 4116847..975ba9d 100755
>> --- a/ovirt-managed-node/src/scripts/ovirt-early
>> +++ b/ovirt-managed-node/src/scripts/ovirt-early
>> @@ -27,7 +27,7 @@ configure_from_network() {
>>                  find_srv ovirt tcp
>>                  printf .
>>                  if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then
>> -                    wget --quiet -O - 
>> "http://$SRV_HOST:$SRV_PORT/ovirt/cfgdb/$(hostname)" \
>> +                    wget -q -O - 
>> "http://$SRV_HOST:$SRV_PORT/ovirt/cfgdb/$(hostname)" \
>>                          | augtool > /dev/null 2>&1
>>                      if [ $? -eq 0 ]; then
>>                          printf "remote config applied."
>> @@ -94,11 +94,13 @@ start() {
>>      done
>>  }
>>  
>> -case "$1" in
>> -    start)
>> -        start
>> -        ;;
>> -    *)
>> -        echo "Usage: ovirt-early {start}"
>> -        exit 2
>> -esac
>> +{
>> +    case "$1" in
>> +        start)
>> +            start
>> +            ;;
>> +        *)
>> +            echo "Usage: ovirt-early {start}"
>> +            exit 2
>> +    esac
>> +} >> $OVIRT_LOGFILE
>> diff --git a/ovirt-managed-node/src/scripts/ovirt-functions 
>> b/ovirt-managed-node/src/scripts/ovirt-functions
>> index 9974533..5b530f7 100644
>> --- a/ovirt-managed-node/src/scripts/ovirt-functions
>> +++ b/ovirt-managed-node/src/scripts/ovirt-functions
>> @@ -1,6 +1,9 @@
>>  # -*-Shell-script-*-
>>  
>> -find_srv() {
>> +OVIRT_LOGFILE=/var/log/ovirt.log
>> +
>> +find_srv()
>> +{
>>      local dnsreply
>>      dnsreply=$(dig +short -t srv _$1._$2.$(dnsdomainname))
>>      if [ $? -eq 0 ]; then
>> diff --git a/ovirt-managed-node/src/scripts/ovirt-post 
>> b/ovirt-managed-node/src/scripts/ovirt-post
>> index 3bb0f6d..fbdc1f6 100755
>> --- a/ovirt-managed-node/src/scripts/ovirt-post
>> +++ b/ovirt-managed-node/src/scripts/ovirt-post
>> @@ -27,11 +27,13 @@ start() {
>>      echo
>>  }
>>  
>> -case "$1" in
>> -    start)
>> -        start
>> -        ;;
>> -    *)
>> -        echo "Usage: ovirt-post {start}"
>> -        exit 2
>> -esac
>> +{
>> +    case "$1" in
>> +        start)
>> +            start
>> +            ;;
>> +        *)
>> +            echo "Usage: ovirt-post {start}"
>> +            exit 2
>> +    esac
>> +} >> $OVIRT_LOGFILE
> 
> 


-- 
|=-        Red Hat, Engineering, Emerging Technologies, Boston        -=|
|=-                     Email: pmyers at redhat.com                      -=|
|=-         Office: +1 412 474 3552   Mobile: +1 703 362 9622         -=|
|=- GnuPG: E65E4F3D 88F9 F1C9 C2F3 1303 01FE 817C C5D2 8B91 E65E 4F3D -=|




More information about the ovirt-devel mailing list