[Ovirt-devel] [PATCH] customization of ovirt-mongrel-rails service

Alan Pevec apevec at redhat.com
Mon Jul 7 17:20:22 UTC 2008


using /etc/sysconfig/ config file instead of editing the init script
ovirt-wui RPM: add default config /etc/sysconfig/ovirt-mongrel-rails with doc comments

Signed-off-by: Alan Pevec <apevec at redhat.com>
---
 wui/conf/ovirt-mongrel-rails         |   19 +++++++++++--------
 wui/conf/ovirt-mongrel-rails.sysconf |   23 +++++++++++++++++++++++
 wui/ovirt-wui.spec                   |    4 +++-
 3 files changed, 37 insertions(+), 9 deletions(-)
 create mode 100644 wui/conf/ovirt-mongrel-rails.sysconf

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
 
diff --git a/wui/conf/ovirt-mongrel-rails.sysconf b/wui/conf/ovirt-mongrel-rails.sysconf
new file mode 100644
index 0000000..c7c97fd
--- /dev/null
+++ b/wui/conf/ovirt-mongrel-rails.sysconf
@@ -0,0 +1,23 @@
+# root directory of the oVirt WUI Rails application
+#OVIRT_DIR=/usr/share/ovirt-wui
+
+# location of the logfile
+#MONGREL_LOG=/var/log/ovirt-wui/mongrel.log
+
+# location of the lockfile
+#MONGREL_LOCKFILE=/var/lock/subsys/ovirt-wui
+
+# location of the file containing running process ID
+#MONGREL_PID=/var/run/ovirt-wui/mongrel.pid
+
+
+# sets ruby on Rails environment / mode of operation
+# http://wiki.rubyonrails.org/rails/pages/Environments
+#RAILS_ENVIRONMENT=production
+
+# user and group under which Rails application runs
+#USER=ovirt
+#GROUP=ovirt
+
+# URL prefix for Rails application
+#PREFIX=/ovirt
diff --git a/wui/ovirt-wui.spec b/wui/ovirt-wui.spec
index 48facb0..9ed33ca 100644
--- a/wui/ovirt-wui.spec
+++ b/wui/ovirt-wui.spec
@@ -57,8 +57,8 @@ mkdir %{buildroot}
 %{__install} -d -m0755 %{buildroot}%{_bindir}
 %{__install} -d -m0755 %{buildroot}%{_sbindir}
 %{__install} -d -m0755 %{buildroot}%{_initrddir}
+%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig
 %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/httpd/conf.d
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig/%{name}
 %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/%{name}
 %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/%{name}/db
 %{__install} -d -m0755 %{buildroot}%{_localstatedir}/lib/%{name}
@@ -76,6 +76,7 @@ touch %{buildroot}%{_localstatedir}/log/%{name}/host-status.log
 %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-host-status %{buildroot}%{_initrddir}
 %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-host-collect %{buildroot}%{_initrddir}
 %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-mongrel-rails %{buildroot}%{_initrddir}
+%{__install} -Dp -m0755 %{pbuild}/conf/ovirt-mongrel-rails.sysconf %{buildroot}%{_sysconfdir}/sysconfig/ovirt-mongrel-rails
 %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-taskomatic %{buildroot}%{_initrddir}
 
 # copy over all of the src directory...
@@ -163,6 +164,7 @@ fi
 %{_initrddir}/ovirt-host-collect
 %{_initrddir}/ovirt-mongrel-rails
 %{_initrddir}/ovirt-taskomatic
+%config(noreplace) %{_sysconfdir}/sysconfig/ovirt-mongrel-rails
 %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
 %doc
 %attr(-, ovirt, ovirt) %{_localstatedir}/lib/%{name}
-- 
1.5.4.1




More information about the ovirt-devel mailing list