- Added support for systemd with the following service files

xenstored.service
  blktapctrl.service
  xend.service
  xenconsoled.service
  xen-watchdog.service
  xendomains.service
  xencommons.service

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=259
This commit is contained in:
Charles Arnold 2013-07-30 21:20:13 +00:00 committed by Git OBS Bridge
parent 11035112e8
commit 9069ef8fe4
9 changed files with 170 additions and 1 deletions

14
blktapctrl.service Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=blktapctrl daemon
RefuseManualStop=true
ConditionPathExists=/proc/xen
[Service]
Type=forking
Environment=BLKTAPCTRL_ARGS=
EnvironmentFile=-/etc/sysconfig/blktapctrl
ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
ExecStart=/usr/sbin/blktapctrl $BLKTAPCTRL_ARGS
[Install]
WantedBy=multi-user.target

12
xen-watchdog.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=Xen-watchdog - run xen watchdog daemon
After=xend.service
ConditionPathExists=/proc/xen
[Service]
Type=forking
ExecStart=/usr/sbin/xenwatchdogd 30 15
KillSignal=USR1
[Install]
WantedBy=multi-user.target

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Mon Jul 29 16:46:33 MDT 2013 - carnold@suse.com
- Added support for systemd with the following service files
xenstored.service
blktapctrl.service
xend.service
xenconsoled.service
xen-watchdog.service
xendomains.service
xencommons.service
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jul 12 11:05:11 MDT 2013 - carnold@suse.com Fri Jul 12 11:05:11 MDT 2013 - carnold@suse.com

View File

@ -42,9 +42,11 @@ ExclusiveArch: %ix86 x86_64 %arm aarch64
%endif %endif
%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
%if %suse_version >= 1230 %if %suse_version >= 1230
%define with_systemd 1
%define with_xend 0 %define with_xend 0
%else %else
%define with_xend 1 %define with_xend 1
%define with_systemd 0
%endif %endif
BuildRequires: LibVNCServer-devel BuildRequires: LibVNCServer-devel
BuildRequires: SDL-devel BuildRequires: SDL-devel
@ -74,6 +76,7 @@ BuildRequires: pciutils-devel
BuildRequires: python-devel BuildRequires: python-devel
BuildRequires: texinfo BuildRequires: texinfo
BuildRequires: transfig BuildRequires: transfig
BuildRequires: systemd
%if %suse_version >= 1120 %if %suse_version >= 1120
BuildRequires: xz-devel BuildRequires: xz-devel
%endif %endif
@ -133,7 +136,7 @@ BuildRequires: xorg-x11
BuildRequires: lndir BuildRequires: lndir
%endif %endif
%endif %endif
Version: 4.3.0_07 Version: 4.3.0_08
Release: 0 Release: 0
PreReq: %insserv_prereq %fillup_prereq PreReq: %insserv_prereq %fillup_prereq
Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel) Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel)
@ -179,6 +182,14 @@ Source33: xend-relocation-server.fw
Source34: init.pciback Source34: init.pciback
Source35: sysconfig.pciback Source35: sysconfig.pciback
Source36: xnloader.py Source36: xnloader.py
# systemd service files
Source40: xenstored.service
Source41: blktapctrl.service
Source42: xend.service
Source43: xenconsoled.service
Source44: xen-watchdog.service
Source45: xendomains.service
Source46: xencommons.service
Source99: baselibs.conf Source99: baselibs.conf
# http://xenbits.xensource.com/ext/xenalyze # http://xenbits.xensource.com/ext/xenalyze
Source20000: xenalyze.hg.tar.bz2 Source20000: xenalyze.hg.tar.bz2
@ -856,6 +867,17 @@ install -m755 %SOURCE36 $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages
mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
mv $RPM_BUILD_ROOT/etc/udev/rules.d/xen-backend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xen.rules mv $RPM_BUILD_ROOT/etc/udev/rules.d/xen-backend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xen.rules
mv $RPM_BUILD_ROOT/etc/udev/rules.d/xend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xend.rules mv $RPM_BUILD_ROOT/etc/udev/rules.d/xend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xend.rules
# systemd
%if %with_systemd
mkdir -p %{buildroot}%{_unitdir}
install -m 644 %{SOURCE40} %{buildroot}%{_unitdir}/xenstored.service
install -m 644 %{SOURCE41} %{buildroot}%{_unitdir}/blktapctrl.service
install -m 644 %{SOURCE42} %{buildroot}%{_unitdir}/xend.service
install -m 644 %{SOURCE43} %{buildroot}%{_unitdir}/xenconsoled.service
install -m 644 %{SOURCE44} %{buildroot}%{_unitdir}/xen-watchdog.service
install -m 644 %{SOURCE45} %{buildroot}%{_unitdir}/xendomains.service
install -m 644 %{SOURCE46} %{buildroot}%{_unitdir}/xencommons.service
%endif
# xen utils # xen utils
make -C tools/xen-utils-0.1 install DESTDIR=$RPM_BUILD_ROOT XEN_INTREE_BUILD=yes XEN_ROOT=$PWD make -C tools/xen-utils-0.1 install DESTDIR=$RPM_BUILD_ROOT XEN_INTREE_BUILD=yes XEN_ROOT=$PWD
# Clean up unpackaged files # Clean up unpackaged files
@ -1088,6 +1110,14 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper
%ifnarch %arm aarch64 %ifnarch %arm aarch64
%config /etc/init.d/pciback %config /etc/init.d/pciback
%endif %endif
%if %with_systemd
%{_unitdir}/xendomains.service
%{_unitdir}/xencommons.service
%{_unitdir}/xenstored.service
%{_unitdir}/blktapctrl.service
%{_unitdir}/xenconsoled.service
%{_unitdir}/xen-watchdog.service
%endif
%dir /etc/modprobe.d %dir /etc/modprobe.d
%dir /etc/udev %dir /etc/udev
%dir /etc/udev/rules.d %dir /etc/udev/rules.d
@ -1153,6 +1183,9 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper
%dir %{_libdir}/python%{pyver}/site-packages/xen/xm %dir %{_libdir}/python%{pyver}/site-packages/xen/xm
%dir %{_libdir}/python%{pyver}/site-packages/xen/web %dir %{_libdir}/python%{pyver}/site-packages/xen/web
%config /etc/init.d/xend %config /etc/init.d/xend
%if %with_systemd
%{_unitdir}/xend.service
%endif
%endif %endif
%dir %attr(700,root,root) /etc/xen %dir %attr(700,root,root) /etc/xen
%config(noreplace) /etc/xen/*.sxp %config(noreplace) /etc/xen/*.sxp
@ -1199,6 +1232,12 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper
%post tools %post tools
%if %{?with_xend}0 %if %{?with_xend}0
# with_xend # with_xend
%if %with_systemd
%{fillup_and_insserv -i -y -n xencommons xencommons}
%{fillup_and_insserv -i -y -n xend xend}
/bin/systemctl enable xend.service
/bin/systemctl enable xencommons.service
%else
# enable both xm (xend based) and xl (libxl based) # enable both xm (xend based) and xl (libxl based)
if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then
if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then
@ -1210,8 +1249,13 @@ else
%{fillup_and_insserv -y -n xencommons xencommons} %{fillup_and_insserv -y -n xencommons xencommons}
fi fi
%{fillup_and_insserv -y -n xend xend} %{fillup_and_insserv -y -n xend xend}
%endif
%else %else
# without_xend # without_xend
%if %with_systemd
%{fillup_and_insserv -i -y -n xencommons xencommons}
/bin/systemctl enable xencommons.service
%else
# disable xm (xend based) and enable only xl (libxl based) # disable xm (xend based) and enable only xl (libxl based)
if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then
if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then
@ -1225,8 +1269,13 @@ else
%{fillup_and_insserv -y -n xencommons xencommons} %{fillup_and_insserv -y -n xencommons xencommons}
fi fi
%endif %endif
%endif
# #
%ifnarch %arm aarch64 %ifnarch %arm aarch64
%if %with_systemd
%{fillup_and_insserv -i -y -n xendomains xendomains}
/bin/systemctl enable xendomains.service
%else
%{fillup_and_insserv -y -n xendomains xendomains} %{fillup_and_insserv -y -n xendomains xendomains}
%{fillup_only -n pciback} %{fillup_only -n pciback}
if [ -f /usr/bin/qemu-img ]; then if [ -f /usr/bin/qemu-img ]; then
@ -1242,9 +1291,16 @@ if [ -f /usr/bin/qemu-nbd ]; then
ln -s /usr/bin/qemu-nbd /usr/bin/qemu-nbd-xen ln -s /usr/bin/qemu-nbd /usr/bin/qemu-nbd-xen
fi fi
%endif %endif
%endif
%preun tools %preun tools
%if %with_systemd
/bin/systemctl disable xend.service
/bin/systemctl disable xencommons.service
/bin/systemctl disable xendomains.service
%else
%{stop_on_removal xendomains xend xencommons} %{stop_on_removal xendomains xend xencommons}
%endif
%postun tools %postun tools
%if %{?with_xend}0 %if %{?with_xend}0

13
xencommons.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=Xencommons - Script to start and stop xenstored and xenconsoled
ConditionPathExists=/proc/xen
[Service]
Type=oneshot
RemainAfterExit=true
ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
ExecStart=-/etc/init.d/xencommons start
ExecStop=/etc/init.d/xencommons stop
[Install]
WantedBy=multi-user.target

17
xenconsoled.service Normal file
View File

@ -0,0 +1,17 @@
[Unit]
Description=Xenconsoled - handles logging from guest consoles and hypervisor
After=xenstored.service
ConditionPathExists=/proc/xen
[Service]
Type=simple
Environment=XENCONSOLED_ARGS=
Environment=XENCONSOLED_LOG=none
Environment=XENCONSOLED_LOG_DIR=/var/log/xen/console
EnvironmentFile=-/etc/sysconfig/xenconsoled
PIDFile=/var/run/xenconsoled.pid
ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
ExecStart=/usr/sbin/xenconsoled --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
[Install]
WantedBy=multi-user.target

14
xend.service Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=Xend - Starts and stops the Xen management daemon
Before=libvirtd.service libvirt-guests.service
ConditionPathExists=/proc/xen
[Service]
Type=forking
PIDFile=/var/run/xend.pid
Environment=HOME=/root
ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
ExecStart=/usr/sbin/xend
[Install]
WantedBy=multi-user.target

15
xendomains.service Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description=Xendomains - start and stop Xen VMs on boot and shutdown
Requires=xenstored.service xenconsoled.service
After=xenstored.service xenconsoled.service
ConditionPathExists=/proc/xen
[Service]
Type=oneshot
RemainAfterExit=true
ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
ExecStart=-/etc/init.d/xendomains start
ExecStop=/etc/init.d/xendomains stop
[Install]
WantedBy=multi-user.target

16
xenstored.service Normal file
View File

@ -0,0 +1,16 @@
[Unit]
Description=Xenstored - daemon managing xenstore file system
Before=libvirtd.service libvirt-guests.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/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
[Install]
WantedBy=multi-user.target