diff --git a/wui/conf/ovirt-host-browser b/wui/conf/ovirt-host-browser new file mode 100755 index 0000000..2037974 --- /dev/null +++ b/wui/conf/ovirt-host-browser @@ -0,0 +1,49 @@ +#!/bin/bash +# +# +# ovirt-host-browser startup script for ovirt-host-browser +# +# chkconfig: - 97 03 +# description: ovirt-host-browser is an essential component of the \ +# ovirt VM manager. +# + +DAEMON=/usr/share/ovirt-wui/host-browser/host-browser + +. /etc/init.d/functions + +start() { + echo -n "Starting ovirt-host-browser: " + daemon $DAEMON + RETVAL=$? + echo +} + +stop() { + echo -n "Shutting down ovirt-host-browser: " + killproc host-browser + RETVAL=$? + echo +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + status) + status $DAEMON + RETVAL=$? + ;; + *) + echo "Usage: ovirt-host-browser {start|stop|restart|status}" + exit 1 + ;; +esac +exit $RETVAL diff --git a/wui/conf/ovirt-host-keyadd b/wui/conf/ovirt-host-keyadd new file mode 100755 index 0000000..836288e --- /dev/null +++ b/wui/conf/ovirt-host-keyadd @@ -0,0 +1,49 @@ +#!/bin/bash +# +# +# ovirt-host-keyadd startup script for ovirt-host-keyadd +# +# chkconfig: - 97 03 +# description: ovirt-host-keyadd is an essential component of the \ +# ovirt VM manager. +# + +DAEMON=/usr/share/ovirt-wui/host-keyadd/host-keyadd.rb + +. /etc/init.d/functions + +start() { + echo -n "Starting ovirt-host-keyadd: " + daemon $DAEMON + RETVAL=$? + echo +} + +stop() { + echo -n "Shutting down ovirt-host-keyadd: " + killproc host-keyadd.rb + RETVAL=$? + echo +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + status) + status $DAEMON + RETVAL=$? + ;; + *) + echo "Usage: ovirt-host-keyadd {start|stop|restart|status}" + exit 1 + ;; +esac +exit $RETVAL diff --git a/wui/conf/ovirt-host-status b/wui/conf/ovirt-host-status new file mode 100755 index 0000000..7804163 --- /dev/null +++ b/wui/conf/ovirt-host-status @@ -0,0 +1,49 @@ +#!/bin/bash +# +# +# ovirt-host-status startup script for ovirt-host-status +# +# chkconfig: - 97 03 +# description: ovirt-host-status is an essential component of the \ +# ovirt VM manager. +# + +DAEMON=/usr/share/ovirt-wui/host-status/host-status.rb + +. /etc/init.d/functions + +start() { + echo -n "Starting ovirt-host-status: " + daemon $DAEMON + RETVAL=$? + echo +} + +stop() { + echo -n "Shutting down ovirt-host-status: " + killproc host-status.rb + RETVAL=$? + echo +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + status) + status $DAEMON + RETVAL=$? + ;; + *) + echo "Usage: ovirt-host-status {start|stop|restart|status}" + exit 1 + ;; +esac +exit $RETVAL diff --git a/wui/conf/ovirt-mongrel-rails b/wui/conf/ovirt-mongrel-rails new file mode 100755 index 0000000..67c03c4 --- /dev/null +++ b/wui/conf/ovirt-mongrel-rails @@ -0,0 +1,77 @@ +#!/bin/bash +# +# +# ovirt-mongrel-rails startup script for ovirt-mongrel-rails +# +# chkconfig: - 97 03 +# description: ovirt-mongrel-rails is an essential component of the \ +# ovirt VM manager. +# + +OVIRT_DIR=/usr/share/ovirt-wui +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 + +. /etc/init.d/functions + +start() { + echo -n "Starting ovirt-mongrel-rails: " + + $MONGREL_PROG start -c $OVIRT_DIR -l $MONGREL_LOG -P $MONGREL_PID \ + -a $ADDR -e $RAILS_ENVIRONMENT --user $USER --group $GROUP \ + -d --prefix=$PREFIX + RETVAL=$? + if [ $RETVAL -eq 0 ] && touch $MONGREL_LOCKFILE ; then + echo_success + echo + else + echo_failure + echo + fi + +} + +stop() { + echo -n "Shutting down ovirt-mongrel-rails: " + $MONGREL_PROG stop -c $OVIRT_DIR -P $MONGREL_PID + RETVAL=$? + if [ $RETVAL -eq 0 ] && rm -f $MONGREL_LOCKFILE ; then + echo_success + echo + else + echo_failure + echo + fi +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + status) + status $MONGREL_PROG + RETVAL=$? + ;; + *) + echo "Usage: ovirt-mongrel-rails {start|stop|restart|status}" + exit 1 + ;; +esac + +exit $RETVAL diff --git a/wui/conf/ovirt-taskomatic b/wui/conf/ovirt-taskomatic new file mode 100755 index 0000000..2f9b255 --- /dev/null +++ b/wui/conf/ovirt-taskomatic @@ -0,0 +1,49 @@ +#!/bin/bash +# +# +# ovirt-taskomatic startup script for ovirt-taskomatic +# +# chkconfig: - 97 03 +# description: ovirt-taskomatic is an essential component of the \ +# ovirt VM manager. +# + +DAEMON=/usr/share/ovirt-wui/task-omatic/taskomatic.rb + +. /etc/init.d/functions + +start() { + echo -n "Starting ovirt-taskomatic: " + daemon $DAEMON + RETVAL=$? + echo +} + +stop() { + echo -n "Shutting down ovirt-taskomatic: " + killproc taskomatic.rb + RETVAL=$? + echo +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + status) + status $DAEMON + RETVAL=$? + ;; + *) + echo "Usage: ovirt-taskomatic {start|stop|restart|status}" + exit 1 + ;; +esac +exit $RETVAL diff --git a/wui/conf/ovirt-wui b/wui/conf/ovirt-wui deleted file mode 100644 index f31b32d..0000000 --- a/wui/conf/ovirt-wui +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -# -# -# ovirt-wui startup script for ovirt-wui -# -# chkconfig: - 97 03 -# description: ovirt-wui is the web front end for ovirt. -# - -OVIRT_DIR=/usr/share/ovirt-wui -MONGREL_LOG=/var/log/ovirt-wui/mongrel.log -MONGREL_PID=/var/run/ovirt-wui/mongrel.pid -ADDR=127.0.0.1 -RAILS_ENVIRONMENT=production -USER=ovirt -GROUP=ovirt -PREFIX=/ovirt - -RETVAL=0 - -. /etc/init.d/functions - -start() { - echo -n "Starting ovirt-wui: " - - mongrel_rails start -c $OVIRT_DIR -l $MONGREL_LOG -P $MONGREL_PID -a $ADDR -e $RAILS_ENVIRONMENT --user $USER --group $GROUP -d --prefix=$PREFIX - RETVAL=$? - if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ovirt-wui ; then - echo_success - echo - else - echo_failure - echo - fi - - echo -n "Starting host-keyadd: " - daemon $OVIRT_DIR/host-keyadd/host-keyadd.rb - echo - - echo -n "Starting host-browser: " - daemon $OVIRT_DIR/host-browser/host-browser - echo - - echo -n "Starting host-status: " - daemon $OVIRT_DIR/host-status/host-status.rb - echo - - echo -n "Starting taskomatic: " - daemon $OVIRT_DIR/task-omatic/taskomatic.rb - echo -} - -stop() { - echo -n "Shutting down taskomatic: " - killproc taskomatic.rb - echo - - echo -n "Shutting down host-status: " - killproc host-status.rb - echo - - echo -n "Shutting down host-browser: " - killproc host-browser - echo - - echo -n "Shutting down host-keyadd: " - killproc host-keyadd.rb - echo - - echo -n "Shutting down ovirt-wui: " - mongrel_rails stop -c $OVIRT_DIR -P $MONGREL_PID - RETVAL=$? - if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ovirt-wui ; then - echo_success - echo - else - echo_failure - echo - fi -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - *) - echo "Usage: ovirt-wui {start|stop|restart}" - exit 1 - ;; -esac - -exit $RETVAL diff --git a/wui/ovirt-wui.spec b/wui/ovirt-wui.spec index c8f84a3..6cdeb2c 100644 --- a/wui/ovirt-wui.spec +++ b/wui/ovirt-wui.spec @@ -74,7 +74,12 @@ touch %{buildroot}%{_localstatedir}/log/%{name}/taskomatic.log touch %{buildroot}%{_localstatedir}/log/%{name}/host-keyadd.log touch %{buildroot}%{_localstatedir}/log/%{name}/host-status.log %{__install} -p -m0644 %{pbuild}/conf/%{name}.conf %{buildroot}%{_sysconfdir}/httpd/conf.d -%{__install} -Dp -m0755 %{pbuild}/conf/%{name} %{buildroot}%{_initrddir} + +%{__install} -Dp -m0755 %{pbuild}/conf/ovirt-host-browser %{buildroot}%{_initrddir} +%{__install} -Dp -m0755 %{pbuild}/conf/ovirt-host-keyadd %{buildroot}%{_initrddir} +%{__install} -Dp -m0755 %{pbuild}/conf/ovirt-host-status %{buildroot}%{_initrddir} +%{__install} -Dp -m0755 %{pbuild}/conf/ovirt-mongrel-rails %{buildroot}%{_initrddir} +%{__install} -Dp -m0755 %{pbuild}/conf/ovirt-taskomatic %{buildroot}%{_initrddir} # copy over all of the src directory... %{__cp} -a %{pbuild}/src/* %{buildroot}%{app_root} @@ -102,7 +107,11 @@ rm -rf $RPM_BUILD_ROOT %{_sbindir}/ovirt-wui-install %{_bindir}/ovirt-add-host %{_bindir}/ovirt-fix-ipa -%{_initrddir}/%{name} +%{_initrddir}/ovirt-host-browser +%{_initrddir}/ovirt-host-keyadd +%{_initrddir}/ovirt-host-status +%{_initrddir}/ovirt-mongrel-rails +%{_initrddir}/ovirt-taskomatic %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf %doc %attr(-, ovirt, ovirt) %{_localstatedir}/lib/%{name} @@ -119,13 +128,27 @@ rm -rf $RPM_BUILD_ROOT -s /sbin/nologin -r -d /var/ovirt ovirt 2> /dev/null || : %post -/sbin/chkconfig --add ovirt-wui +#removes legacy ovirt-wui script if present +if [ -e %{_initrddir}/ovirt-wui ] ; then + /sbin/service ovirt-wui stop > /dev/null 2>&1 + /sbin/chkconfig --del ovirt-wui + %{__rm} %{_initrddir}/ovirt-wui +fi + exit 0 %preun if [ "$1" = 0 ] ; then - /sbin/service ovirt-wui stop > /dev/null 2>&1 - /sbin/chkconfig --del ovirt-wui + /sbin/service ovirt-host-browser stop > /dev/null 2>&1 + /sbin/service ovirt-host-keyadd stop > /dev/null 2>&1 + /sbin/service ovirt-host-status stop > /dev/null 2>&1 + /sbin/service ovirt-mongrel-rails stop > /dev/null 2>&1 + /sbin/service ovirt-taskomatic stop > /dev/null 2>&1 + /sbin/chkconfig --del ovirt-host-browser + /sbin/chkconfig --del ovirt-host-keyadd + /sbin/chkconfig --del ovirt-host-status + /sbin/chkconfig --del ovirt-mongrel-rails + /sbin/chkconfig --del ovirt-taskomatic fi %changelog * Fri Nov 2 2007 - 0.0.1-1 diff --git a/wui/scripts/ovirt-wui-install b/wui/scripts/ovirt-wui-install index 4462b6a..e0cbbc0 100755 --- a/wui/scripts/ovirt-wui-install +++ b/wui/scripts/ovirt-wui-install @@ -13,7 +13,8 @@ STEP_FILE=/etc/ntp/step-tickers SASL_FILE=/etc/sasl2/libvirt.conf DISABLE_SVCS="libvirtd" -ENABLE_SVCS="ntpd httpd postgresql ovirt-wui" +ENABLE_SVCS="ntpd httpd postgresql ovirt-host-browser ovirt-host-status \ + ovirt-taskomatic ovirt-host-keyadd ovirt-mongrel-rails" usage() { echo "usage: $0 [-p password]"