Alan Pevec
2008-Jul-07 08:26 UTC
[Ovirt-devel] [PATCH] customization of ovirt-mongrel-rails service
using /etc/sysconfig/ config file instead of editing the init script
Signed-off-by: Alan Pevec <apevec at redhat.com>
---
wui/conf/ovirt-mongrel-rails | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
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
--
1.5.4.1
Mohammed Morsi
2008-Jul-07 16:32 UTC
[Ovirt-devel] [PATCH] customization of ovirt-mongrel-rails service
Alan Pevec wrote:> using /etc/sysconfig/ config file instead of editing the init script > >ACK. Just tried this on my local oVirt appliance and it works great for switching between the copy of oVirt that comes with the appliance in /usr/share/ovirt-wui and an updatable copy pulled from git which I checked out in my home dir. The /etc/sysconfig/ovirt-mongrel-rails script should probably be added to the project and the oVirt RPM eventually, but it not being there doesn't break anything so its not a big deal. Once this is committed, I'll commit my fixes to the test cases as previously acked (pending this patch) by hugh. -Mo