Alan Pevec
2011-Aug-10 23:59 UTC
[Ovirt-devel] [PATCH] install libvirtd systemd service on Fedora
unit file taken from http://www.redhat.com/archives/libvir-list/2011-July/msg00343.html (modified to include Before=ovirt-post) --- Makefile.am | 1 + libvirtd.service | 16 ++++++++++++++++ ovirt-node.spec.in | 15 ++++++++++++++- recipe/ovirt16-install.ks | 2 +- 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 libvirtd.service diff --git a/Makefile.am b/Makefile.am index fe826f5..58a105e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,6 +27,7 @@ SUBDIRS = \ EXTRA_DIST = \ vlan.modules \ + libvirtd.service \ libvirtd.upstart \ ovirt-node.spec \ ovirt-node.spec.in \ diff --git a/libvirtd.service b/libvirtd.service new file mode 100644 index 0000000..7a4a625 --- /dev/null +++ b/libvirtd.service @@ -0,0 +1,16 @@ +[Unit] +Description=Virtualization daemon +After=syslog.target +After=udev.target +After=avahi.target +After=dbus.target +Before=libvirt-guests.service +Before=ovirt-post.service + +[Service] +EnvironmentFile=-/etc/sysconfig/libvirtd +ExecStart= /usr/sbin/libvirtd $LIBVIRTD_ARGS +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in index b2ad85b..60d3276 100644 --- a/ovirt-node.spec.in +++ b/ovirt-node.spec.in @@ -20,6 +20,7 @@ BuildRequires: automake autoconf Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig %if 0%{?fedora} +Requires: systemd-units Requires: python-augeas Requires: glusterfs-client >= 2.0.1 Requires: anyterm @@ -108,9 +109,16 @@ make install DESTDIR=%{buildroot} %{__install} -p -m0644 logrotate/ovirt-logrotate %{buildroot}%{_sysconfdir}/cron.d %{__install} -p -m0644 logrotate/ovirt-logrotate.conf %{buildroot}%{_sysconfdir}/logrotate.d/ovirt-node -# configure libvirtd upstart job +%if 0%{?fedora} +# install libvirtd systemd service +%{__install} -d -m0755 %{buildroot}%{_unitdir} +%{__install} -p -m0644 libvirtd.service %{buildroot}%{_unitdir} +%endif +%if 0%{?rhel} +# install libvirtd upstart job %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/init %{__install} -p -m0644 libvirtd.upstart %{buildroot}%{_sysconfdir}/init/libvirtd.conf +%endif # load vlan module %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig/modules %{__install} -p -m0755 vlan.modules %{buildroot}%{_sysconfdir}/sysconfig/modules @@ -231,7 +239,12 @@ fi %{_sysconfdir}/ovirt-config-boot.d %config(noreplace) %{_sysconfdir}/sysconfig/node-config +%if 0%{?fedora} +%{_unitdir}/libvirtd.service +%endif +%if 0%{?rhel} %{_sysconfdir}/init/libvirtd.conf +%endif %{_sysconfdir}/sysconfig/modules/vlan.modules diff --git a/recipe/ovirt16-install.ks b/recipe/ovirt16-install.ks index 29684af..7b99b5e 100644 --- a/recipe/ovirt16-install.ks +++ b/recipe/ovirt16-install.ks @@ -1 +1 @@ -services --enabled=auditd,ntpd,ntpdate,iptables,network,rsyslog,multipathd,snmpd,ovirt-early,ovirt,ovirt-post,anyterm,collectd,libvirt-qmf,matahari-host --disabled=libvirtd +services --enabled=auditd,ntpd,ntpdate,iptables,network,rsyslog,multipathd,snmpd,ovirt-early,ovirt,ovirt-post,anyterm,collectd,libvirt-qmf,matahari-host,libvirtd -- 1.7.3.4