Eli Mesika has posted comments on this change.

Change subject: core: Provide a wrapper script with ovirt to...
......................................................................


Patch Set 4:

(6 comments)

Alon asked :
  how will this interact with log rotation?

Answer: currently out of the scope of this feature

....................................................
Commit Message
Line 6: 
Line 7: core: Provide a wrapper script with ovirt to...
Line 8: 
Line 9: Provide a wrapper script with ovirt to ensure all custom SQL
Line 10: statements executed by support are logged
Done
Line 11: 
Line 12:  The purpose of this script is to be a wrapper for support data
Line 13:  manipulations on the database done up to now by psql.
Line 14: 


....................................................
File backend/manager/tools/dbutils/engine-psql.sh
Line 1: #!/bin/bash
Done
Line 2: 
#################################################################################
Line 3: # The purpose of this script is to be a wrapper for support data 
manipulations on the
Line 4: #   database done up to now by psql.
Line 5: # The script supports all original psql flags and records the executed 
SQL and its


Line 16:     exit 0
Line 17: }
Line 18: 
Line 19: permission_error() {
Line 20:     echo -e "Insufficient permissions on $LOGDIR, \n Please execute 
again with a user that has write accees to this directory or use sudo"
Done
Line 21:     exit 4
Line 22: }
Line 23: 
Line 24: # Check for all available command switches but change only -c and -f 
behaviour


Line 21:     exit 4
Line 22: }
Line 23: 
Line 24: # Check for all available command switches but change only -c and -f 
behaviour
Line 25: while getopts c:d:f:v:p:U:h:hlvX1aeELnoqsSAFHPRtTxz0wW option; do
Done
Line 26:     case $option in
Line 27:         c) COMMAND=$OPTARG;;
Line 28:         f) FILE=$OPTARG;;
Line 29:         h) ret=0 && usage;;


Line 30:        \?) ret=1 && usage;;
Line 31:     esac
Line 32: done
Line 33: 
Line 34: LOGDIR="/var/log/ovirt-engine"
Done
Line 35: if [ ! -d "${LOGDIR}" ]; then
Line 36:     echo "Can not find log directory ${LOGDIR}"
Line 37:     exit 1
Line 38: fi


Line 58:         permission_error
Line 59:     fi
Line 60: fi
Line 61: 
Line 62: psql ${PARAMS}  &>> ${LOGFILE}
Done
Line 63: if [ $? -ne 0 ]; then
Line 64:     echo "$(date): Failed to execute command ${0} $*" >> ${LOGFILE}
Line 65:     exit 2


-- 
To view, visit http://gerrit.ovirt.org/16273
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I468f830196bd95dc013a5142f9aa0d508e687d90
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Lee Yarwood <lyarw...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to