Mohammed Morsi
2009-May-29 14:55 UTC
[Ovirt-devel] [PATCH server] convenience init script starting/stopping all ovirt services
-------------- next part -------------- An embedded message was scrubbed... From: Mohammed Morsi <mmorsi at redhat.com> Subject: [PATCH server] convenience init script starting/stopping all ovirt services Date: Tue, 10 Mar 2009 13:37:05 -0400 Size: 3736 URL: <listman.redhat.com/archives/ovirt-devel/attachments/20090529/5fac9453/attachment.eml>
Mohammed Morsi
2009-May-29 15:22 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..e125f32 --- /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 ovirt-vnc-proxy ) + +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 {start|stop|restart}" + exit 1 + ;; +esac +exit $RETVAL diff --git a/ovirt-server.spec.in b/ovirt-server.spec.in index 68f3a2e..345a51d 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-rails.sysconf %{buildroot}%{_sysconfdir}/sysconfig/ovirt-rails %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-taskomatic %{buildroot}%{_initrddir} %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-vnc-proxy %{buildroot}%{_initrddir} +%{__install} -Dp -m0755 %{pbuild}/conf/ovirt %{buildroot}%{_initrddir} # copy over all of the src directory... %{__cp} -a %{pbuild}/src/* %{buildroot}%{app_root} @@ -210,6 +211,7 @@ fi %{_initrddir}/ovirt-mongrel-rails %{_initrddir}/ovirt-taskomatic %{_initrddir}/ovirt-vnc-proxy +%{_initrddir}/ovirt %{_sysconfdir}/cron.d/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/ovirt-mongrel-rails %config(noreplace) %{_sysconfdir}/sysconfig/ovirt-rails -- 1.6.0.6