[Ovirt-devel] [Patch] Fixed Test Cases

Alan Pevec apevec at redhat.com
Wed Jul 2 08:10:43 UTC 2008


Hugh O. Brock wrote:
> On Tue, Jul 01, 2008 at 05:06:26PM -0400, Mohammed Morsi wrote:
>> Attached (includes the latest fix). Also found that when developing on  
>> the oVirt appliance, switching the server to look at a oVirt copy you  
>> checked out instead of /usr/share/ovirt-wui is as simple as editing  
>> /etc/init.d/ovirt-mongrel-rails and changing the OVIRT_DIR at the top of  
>> the file and restarting the server. (you will also have to change  
>> config/ldap.yml in your ovirt checkout to point to the correct ldap 
>> server).

> This looks good to me with one caveat: Even for developer config, we
> shouldn't ever have to edit an init script -- if a value in an init
> script needs to change, we should put it in a config file under /etc
> (right apevec?). Can you check with Alan and work out the right way to
> do this? In general I think the idea of being able to repoint the
> Mongrel server for development purposes is very cool.
> 
> With that fixed I will ACK.

Usual place for service customization is /etc/sysconfig/<servicename>, overriding default values.
Something like this should be applied to all sysV service scripts:

diff --git a/wui/conf/ovirt-mongrel-rails b/wui/conf/ovirt-mongrel-rails
index 67c03c4..9c770ac 100755
--- a/wui/conf/ovirt-mongrel-rails
+++ b/wui/conf/ovirt-mongrel-rails
@@ -8,16 +8,19 @@
 #    ovirt VM manager.
 #
 
-OVIRT_DIR=/usr/share/ovirt-wui
+[ -r /etc/sysconfig/ovirt-mongrel-rails ] && . /etc/sysconfig/ovirt-mongrel-rails
+
+OVIRT_DIR="${OVIRT_DIR:-/usr/share/ovirt-wui}"
+MONGREL_LOG="${MONGREL_LOG:-/var/log/ovirt-wui/mongrel.log}"
+MONGREL_PID="${MONGREL_PID:-/var/run/ovirt-wui/mongrel.pid}"
+MONGREL_LOCKFILE="${MONGREL_LOCKFILE:-/var/lock/subsys/ovirt-wui}"
+RAILS_ENVIRONMENT="${RAILS_ENVIRONMENT:-production}"
+USER="${USER:-ovirt}"
+GROUP="${GROUP:-ovirt}"
+PREFIX="${PREFIX:-/ovirt}"
+
 MONGREL_PROG=mongrel_rails
-MONGREL_LOG=/var/log/ovirt-wui/mongrel.log
-MONGREL_PID=/var/run/ovirt-wui/mongrel.pid
-MONGREL_LOCKFILE=/var/lock/subsys/ovirt-wui
 ADDR=127.0.0.1
-RAILS_ENVIRONMENT=production
-USER=ovirt
-GROUP=ovirt
-PREFIX=/ovirt
 
 RETVAL=0
 




More information about the ovirt-devel mailing list