Mohammed Morsi
2009-Mar-10 17:37 UTC
[Ovirt-devel] [PATCH server] convenience init script starting/stopping all ovirt services
--- conf/ovirt | 47 +++++++++++++++++++++++++++++++++++++++++++++++ ovirt-server.spec.in | 2 ++ 2 files changed, 49 insertions(+), 0 deletions(-) create mode 100755 conf/ovirt diff --git a/conf/ovirt b/conf/ovirt new file mode 100755 index 0000000..d04b277 --- /dev/null +++ b/conf/ovirt @@ -0,0 +1,47 @@ +#!/bin/bash +# +# +# ovirt startup script for ovirt services +# +# chkconfig: - 97 03 +# description: ovirt runs all services part of the ovirt server framework +# + +. /etc/init.d/functions + +SERVICE_CMD=/sbin/service + +SERVICES=( ovirt-db-omatic ovirt-host-browser ovirt-host-collect \ + ovirt-mongrel-rails ovirt-taskomatic ) + +start() { + for service in ${SERVICES[@]} + do + $SERVICE_CMD $service start + done +} + +stop() { + for service in ${SERVICES[@]} + do + $SERVICE_CMD $service stop + done +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + *) + echo "Usage: ovirt-taskomatic {start|stop|restart}" + exit 1 + ;; +esac +exit $RETVAL diff --git a/ovirt-server.spec.in b/ovirt-server.spec.in index b2ffdd6..78518f4 100644 --- a/ovirt-server.spec.in +++ b/ovirt-server.spec.in @@ -104,6 +104,7 @@ touch %{buildroot}%{_localstatedir}/log/%{name}/db-omatic.log %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-mongrel-rails.sysconf %{buildroot}%{_sysconfdir}/sysconfig/ovirt-mongrel-rails %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-rails.sysconf %{buildroot}%{_sysconfdir}/sysconfig/ovirt-rails %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-taskomatic %{buildroot}%{_initrddir} +%{__install} -Dp -m0755 %{pbuild}/conf/ovirt %{buildroot}%{_initrddir} # copy over all of the src directory... %{__cp} -a %{pbuild}/src/* %{buildroot}%{app_root} @@ -204,6 +205,7 @@ fi %{_initrddir}/ovirt-host-collect %{_initrddir}/ovirt-mongrel-rails %{_initrddir}/ovirt-taskomatic +%{_initrddir}/ovirt %{_sysconfdir}/cron.d/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/ovirt-mongrel-rails %config(noreplace) %{_sysconfdir}/sysconfig/ovirt-rails -- 1.6.0.6