Accepting request 139959 from home:elvigia:branches:Base:System

- Systemd: use default service type instead of forking
- Systemd: fix spec pre/post scripts.

OBS-URL: https://build.opensuse.org/request/show/139959
OBS-URL: https://build.opensuse.org/package/show/Base:System/multipath-tools?expand=0&rev=40
This commit is contained in:
Cristian Rodríguez 2012-11-04 02:57:33 +00:00 committed by Git OBS Bridge
parent 36b86c1e9b
commit 7b67733512
3 changed files with 40 additions and 2 deletions

13
mpath-tools-service.patch Normal file
View File

@ -0,0 +1,13 @@
--- multipathd/multipathd.service.orig
+++ multipathd/multipathd.service
@@ -4,9 +4,7 @@ Before=iscsi.service iscsid.service
After=syslog.target
[Service]
-Type=forking
-PIDFile=/var/run/multipathd.pid
-ExecStart=/sbin/multipathd
+ExecStart=/sbin/multipathd -d
ExecReload=/sbin/multipathd reconfigure
#ExecStop=/path/to/scrip delete-me if not necessary

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Aug 26 02:05:37 UTC 2012 - crrodriguez@opensuse.org
- Systemd: use default service type instead of forking
- Systemd: fix spec pre/post scripts.
-------------------------------------------------------------------
Tue Jul 17 13:21:47 UTC 2012 - rmilasan@suse.com

View File

@ -33,6 +33,12 @@ Source: multipath-tools-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Patch0: %{name}-%{version}-opensuse-12.2.diff.bz2
Patch1: 0002-fix-installation-of-multipath-rule.patch
Patch2: mpath-tools-service.patch
%if 0%{?suse_version} >= 1210
BuildRequires: systemd
%{?systemd_requires}
%define has_systemd 1
%endif
%description
This package provides the tools to manage multipathed devices by
@ -74,7 +80,7 @@ Authors:
%setup -q -n multipath-tools-%{version}
%patch0 -p1
%patch1 -p1
%patch2
%build
make CC="%__cc" OPTFLAGS="$RPM_OPT_FLAGS" LIB=%_lib
@ -85,18 +91,24 @@ rm $RPM_BUILD_ROOT/usr/include/mpath_persist.h
rm $RPM_BUILD_ROOT/%_lib/libmpathpersist.so
%clean
[ "$RPM_BUILD_ROOT" != / ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
rm -rf $RPM_BUILD_ROOT;
%pre
[ -f /.buildenv ] && exit 0
if [ -f /etc/init.d/multipathd ] && dmsetup --target multipath table | grep -q multipath ; then
/etc/init.d/multipathd stop
%if 0%{?has_systemd}
%service_add_pre multipathd.service
%endif
fi
%post
[ -f /.buildenv ] && exit 0
if dmsetup --target multipath table | grep -q multipath ; then
/etc/init.d/multipathd start
%if 0%{?has_systemd}
%service_add_post multipathd.service
%endif
fi
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
@ -112,6 +124,9 @@ exit 0
%preun
%stop_on_removal multipathd
%if 0%{?has_systemd}
%service_del_preun multipathd.service
%endif
%postun
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
@ -122,6 +137,10 @@ elif [ -x /sbin/mkinitrd ]; then
/sbin/mkinitrd
fi
%if 0%{?has_systemd}
%service_del_postun multipathd.service
%endif
%{insserv_cleanup}
%files