diff -r 4e004f5935ec qemud/Makefile.am --- a/qemud/Makefile.am Thu Jun 21 20:18:59 2007 -0400 +++ b/qemud/Makefile.am Thu Jun 21 20:28:37 2007 -0400 @@ -32,7 +32,7 @@ libvirt_qemud_DEPENDENCIES = ../src/libv libvirt_qemud_DEPENDENCIES = ../src/libvirt.la libvirt_qemud_LDADD = ../src/libvirt.la -install-data-local: +install-data-local: install-init mkdir -p $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart $(INSTALL_DATA) $(srcdir)/default-network.xml $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml sed -i -e "s,,\n $(UUID)," $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml @@ -42,7 +42,7 @@ install-data-local: mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt -uninstall-local: +uninstall-local: uninstall-init rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml rmdir $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart || : @@ -52,7 +52,7 @@ uninstall-local: # Distribute the generated files so that rpcgen isn't required on the # target machine (although almost any Unix machine will have it). -EXTRA_DIST = libvirtd.in default-network.xml \ +EXTRA_DIST = libvirtd.init.in default-network.xml \ protocol.x remote_protocol.x \ protocol.c protocol.h \ remote_protocol.c remote_protocol.h \ @@ -88,16 +88,25 @@ remote_dispatch_proc_switch.h: remote_ge perl -w remote_generate_stubs.pl -w remote_protocol.x > $@ if LIBVIRT_INIT_SCRIPTS_RED_HAT -initdir = $(sysconfdir)/rc.d/init.d -init_SCRIPTS = libvirtd +install-init: libvirtd.init + mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d + $(INSTALL_SCRIPT) $(srcdir)/libvirtd.init $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd -libvirtd: libvirtd.in +uninstall-init: + rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd + +libvirtd.init: libvirtd.init.in sed \ -e s!\@localstatedir\@!@localstatedir@! \ -e s!\@sbindir\@!@sbindir@! \ -e s!\@sysconfdir\@!@sysconfdir@! \ < $< > $@ - chmod a+x libvirtd + chmod a+x libvirtd.init -CLEANFILES = libvirtd +CLEANFILES = libvirtd.init +else + +install-init: +uninstall-init: + endif # DBUS_INIT_SCRIPTS_RED_HAT diff -r 4e004f5935ec qemud/libvirtd.in --- a/qemud/libvirtd.in Thu Jun 21 20:18:59 2007 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -#!/bin/sh - -# libvirt_qemud: QEMU and virtual network management daemon -# -# chkconfig: 345 97 03 -# description: This is a daemon for managing QEMU guest instances -# and libvirt virtual networks -# See http://libvirt.org -# -# processname: libvirt_qemud -# pidfile: @localstatedir@/run/libvirt_qemud.pid -# - -# Sanity checks. -[ -x @sbindir@/libvirt_qemud ] || exit 0 - -# Source function library. -. @sysconfdir@/rc.d/init.d/functions - -SERVICE=libvirtd -PROCESS=libvirt_qemud - - -RETVAL=0 - -start() { - echo -n $"Starting $SERVICE daemon: " - daemon --check $SERVICE $PROCESS --system --daemon - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE -} - -stop() { - echo -n $"Stopping $SERVICE daemon: " - - killproc $PROCESS - RETVAL=$? - echo - if [ $RETVAL -eq 0 ]; then - rm -f @localstatedir@/lock/subsys/$SERVICE - rm -f @localstatedir@/run/$SERVICE.pid - fi -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading $SERVICE configuration: " - - killproc $PROCESS -HUP - RETVAL=$? - echo - return $RETVAL -} - -# See how we were called. -case "$1" in - start|stop|restart|reload) - $1 - ;; - status) - status $PROCESS - RETVAL=$? - ;; - condrestart) - [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" - exit 1 - ;; -esac -exit $RETVAL diff -r 4e004f5935ec qemud/libvirtd.init.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qemud/libvirtd.init.in Thu Jun 21 20:25:28 2007 -0400 @@ -0,0 +1,77 @@ +#!/bin/sh + +# libvirt_qemud: QEMU and virtual network management daemon +# +# chkconfig: 345 97 03 +# description: This is a daemon for managing QEMU guest instances +# and libvirt virtual networks +# See http://libvirt.org +# +# processname: libvirt_qemud +# pidfile: @localstatedir@/run/libvirt_qemud.pid +# + +# Sanity checks. +[ -x @sbindir@/libvirt_qemud ] || exit 0 + +# Source function library. +. @sysconfdir@/rc.d/init.d/functions + +SERVICE=libvirtd +PROCESS=libvirt_qemud + + +RETVAL=0 + +start() { + echo -n $"Starting $SERVICE daemon: " + daemon --check $SERVICE $PROCESS --system --daemon + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE +} + +stop() { + echo -n $"Stopping $SERVICE daemon: " + + killproc $PROCESS + RETVAL=$? + echo + if [ $RETVAL -eq 0 ]; then + rm -f @localstatedir@/lock/subsys/$SERVICE + rm -f @localstatedir@/run/$SERVICE.pid + fi +} + +restart() { + stop + start +} + +reload() { + echo -n $"Reloading $SERVICE configuration: " + + killproc $PROCESS -HUP + RETVAL=$? + echo + return $RETVAL +} + +# See how we were called. +case "$1" in + start|stop|restart|reload) + $1 + ;; + status) + status $PROCESS + RETVAL=$? + ;; + condrestart) + [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || : + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" + exit 1 + ;; +esac +exit $RETVAL