From 9cd22a4d768524538f8a73917914351c18b2f7e9 Mon Sep 17 00:00:00 2001 From: Michael Young Date: Oct 24 2013 21:21:16 +0000 Subject: systemd changes to allow oxenstored to be used instead of xenstored --- diff --git a/oxenstored.service b/oxenstored.service new file mode 100644 index 0000000..915c0aa --- /dev/null +++ b/oxenstored.service @@ -0,0 +1,20 @@ +[Unit] +Description=Oxenstored - ocaml version of daemon managing xenstore file system +Requires=proc-xen.mount var-lib-xenstored.mount +After=proc-xen.mount var-lib-xenstored.mount +Before=libvirtd.service libvirt-guests.service +Conflicts=xenstored.service +RefuseManualStop=true +ConditionPathExists=/proc/xen + +[Service] +Type=forking +Environment=XENSTORED_ARGS= +EnvironmentFile=-/etc/sysconfig/xenstored +PIDFile=/var/run/xenstored.pid +ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities +ExecStart=/usr/sbin/oxenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS +ExecStartPost=-/usr/bin/xenstore-write "/local/domain/0/name" "Domain-0" + +[Install] +WantedBy=multi-user.target diff --git a/xen.spec b/xen.spec index fbd4b66..b119340 100644 --- a/xen.spec +++ b/xen.spec @@ -46,7 +46,7 @@ Summary: Xen is a virtual machine monitor Name: xen Version: 4.3.0 -Release: 8%{?dist} +Release: 9%{?dist} Group: Development/Libraries License: GPLv2+ and LGPLv2+ and BSD URL: http://xen.org/ @@ -80,6 +80,7 @@ Source46: xen-watchdog.service Source47: xendomains.service Source48: libexec.xendomains Source49: tmpfiles.d.xen.conf +Source50: oxenstored.service Patch1: xen-initscript.patch Patch4: xen-dumpdir.patch @@ -444,6 +445,7 @@ install -m 755 %{SOURCE48} %{buildroot}%{_libexecdir}/xendomains mkdir -p %{buildroot}/usr/lib/tmpfiles.d install -m 644 %{SOURCE49} %{buildroot}/usr/lib/tmpfiles.d/xen.conf %endif +install -m 644 %{SOURCE50} %{buildroot}%{_unitdir}/oxenstored.service # config file only used for hotplug, Fedora uses udev instead rm -f %{buildroot}/%{_sysconfdir}/sysconfig/xend @@ -555,6 +557,20 @@ if [ -f /sbin/grub2-mkconfig -a -f /boot/grub2/grub.cfg ]; then fi %endif +%post ocaml +%if %with_systemd +if [ $1 == 1 ]; then + /bin/systemctl enable oxenstored.service +fi +%endif + +%preun ocaml +%if %with_systemd +if [ $1 == 0 ]; then + /bin/systemctl disable oxenstored.service +fi +%endif + %clean rm -rf %{buildroot} @@ -798,6 +814,7 @@ rm -rf %{buildroot} %{_libdir}/ocaml/stublibs/*.so.owner %{_sbindir}/oxenstored %config(noreplace) %{_sysconfdir}/xen/oxenstored.conf +%{_unitdir}/oxenstored.service %files ocaml-devel %defattr(-,root,root) @@ -807,6 +824,9 @@ rm -rf %{buildroot} %endif %changelog +* Thu Oct 24 2013 Michael Young - 4.3.0-9 +- systemd changes to allow oxenstored to be used instead of xenstored + * Thu Oct 10 2013 Michael Young - 4.3.0-8 - security fixes (#1017843) Information leak through outs instruction emulation in 64-bit PV guests diff --git a/xenconsoled.service b/xenconsoled.service index 4c5429f..daee72d 100644 --- a/xenconsoled.service +++ b/xenconsoled.service @@ -1,7 +1,7 @@ [Unit] Description=Xenconsoled - handles logging from guest consoles and hypervisor Requires=proc-xen.mount -After=proc-xen.mount xenstored.service +After=proc-xen.mount xenstored.service oxenstored.service ConditionPathExists=/proc/xen [Service] diff --git a/xendomains.service b/xendomains.service index 0bd72d7..2062ae6 100644 --- a/xendomains.service +++ b/xendomains.service @@ -1,7 +1,7 @@ [Unit] Description=Xendomains - start and stop guests on boot and shutdown -Requires=proc-xen.mount xenstored.service -After=proc-xen.mount xenstored.service xenconsoled.service +Requires=proc-xen.mount +After=proc-xen.mount xenstored.service xenconsoled.service oxenstored.service ConditionPathExists=/proc/xen [Service]