Make fcoe-utils systemd aware (#714683)

Also, ancient scriptlets were removed, quickstart documentation updated
and some rpmlint issues resolved.
This commit is contained in:
Petr Sabata 2011-07-18 15:38:27 +02:00
parent a234c3bb04
commit 8f401962e9
4 changed files with 65 additions and 54 deletions

View File

@ -1,35 +1,38 @@
Name: fcoe-utils Name: fcoe-utils
Version: 1.0.20 Version: 1.0.20
Release: 1%{?dist} Release: 2%{?dist}
Summary: Fibre Channel over Ethernet utilities Summary: Fibre Channel over Ethernet utilities
Group: Applications/System Group: Applications/System
License: GPLv2 License: GPLv2
URL: http://www.open-fcoe.org URL: http://www.open-fcoe.org
# git://open-fcoe.org/fcoe/fcoe-utils.git # git://open-fcoe.org/fcoe/fcoe-utils.git
Source0: %{name}-%{version}.tar.bz2 Source0: %{name}-%{version}.tar.bz2
Source1: quickstart.txt Source1: quickstart.txt
Source2: fcoe.service
Source3: fcoe.config
# Generic Fedora patches # Generic Fedora patches
Patch0: fcoe-utils-1.0.20-init.patch Patch0: fcoe-utils-1.0.20-init.patch
Patch1: fcoe-utils-1.0.19-make.patch Patch1: fcoe-utils-1.0.19-make.patch
Patch2: fcoe-utils-1.0.18-help.patch Patch2: fcoe-utils-1.0.18-help.patch
Patch3: fcoe-utils-1.0.18-config.patch Patch3: fcoe-utils-1.0.18-config.patch
BuildRequires: libtool automake autoconf BuildRequires: libtool automake autoconf
BuildRequires: lldpad-devel >= 0.9.43 BuildRequires: lldpad-devel >= 0.9.43
BuildRequires: libhbaapi-devel >= 2.2-12 BuildRequires: libhbaapi-devel >= 2.2-12
BuildRequires: libnl-devel BuildRequires: libnl-devel
BuildRequires: systemd-units
Requires: lldpad >= 0.9.43 Requires: lldpad >= 0.9.43
Requires: libhbalinux >= 1.0.12 Requires: libhbalinux >= 1.0.12
Requires: iproute Requires: iproute
Requires: device-mapper-multipath Requires: device-mapper-multipath
Requires(post): chkconfig Requires(post): systemd-units
Requires(preun): chkconfig initscripts Requires(preun): systemd-units
Requires(postun): initscripts Requires(postun): systemd-units
%description %description
Fibre Channel over Ethernet utilities Fibre Channel over Ethernet utilities
fcoeadm - command line tool for configuring FCoE interfaces fcoeadm - command line tool for configuring FCoE interfaces
fcoemon - service to configure DCB Ethernet QOS filters, works with dcbd or lldpad fcoemon - service to configure DCB Ethernet QOS filters, works with dcbd
or lldpad
%prep %prep
%setup -q %setup -q
@ -45,12 +48,11 @@ make %{?_smp_mflags}
%install %install
make install DESTDIR=%{buildroot} make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}%{_initrddir}
mv %{buildroot}/etc/init.d/fcoe %{buildroot}%{_initrddir}/fcoe
rm -rf %{buildroot}/etc/init.d rm -rf %{buildroot}/etc/init.d
install -m 644 %SOURCE1 quickstart.txt install -m 644 %{SOURCE1} quickstart.txt
mkdir -p %{buildroot}%{_sysconfdir}/fcoe/ mkdir -p %{buildroot}%{_sysconfdir}/sysconfig %{buildroot}%{_unitdir}
cp etc/config %{buildroot}%{_sysconfdir}/fcoe/config install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}
install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/fcoe
mkdir -p %{buildroot}%{_libexecdir}/fcoe mkdir -p %{buildroot}%{_libexecdir}/fcoe
install -m 755 contrib/fcc.sh %{buildroot}%{_libexecdir}/fcoe/fcc.sh install -m 755 contrib/fcc.sh %{buildroot}%{_libexecdir}/fcoe/fcc.sh
install -m 755 contrib/fcoe_edd.sh %{buildroot}%{_libexecdir}/fcoe/fcoe_edd.sh install -m 755 contrib/fcoe_edd.sh %{buildroot}%{_libexecdir}/fcoe/fcoe_edd.sh
@ -59,44 +61,31 @@ install -m 755 debug/fcoedump.sh %{buildroot}%{_libexecdir}/fcoe/fcoedump.sh
install -m 755 debug/dcbcheck.sh %{buildroot}%{_libexecdir}/fcoe/dcbcheck.sh install -m 755 debug/dcbcheck.sh %{buildroot}%{_libexecdir}/fcoe/dcbcheck.sh
%post %post
/sbin/chkconfig --add fcoe if [ $1 -eq 1 ]; then
systemctl enable fcoe.service
%triggerun -- fcoe-utils <= 1.0.7-5
if [ -x %{_initrddir}/fcoe-utils ]; then
/sbin/service fcoe-utils stop > /dev/null 2>&1
/sbin/chkconfig fcoe-utils off
# now copy an updated file, which we need to do proper condrestart
sed 's/\/var\/lock\/subsys\/fcoe/\/var\/lock\/subsys\/fcoe-utils/' %{_initrddir}/fcoe > %{_initrddir}/fcoe-utils
fi
%triggerpostun -- fcoe-utils <= 1.0.7-5
if [ -x %{_initrddir}/fcoe-utils ]; then
rm -f %{_initrddir}/fcoe-utils # this file should be already deleted, but just in case ...
fi fi
%preun %preun
if [ $1 = 0 ]; then if [ $1 -eq 0 ]; then
/sbin/service fcoe stop > /dev/null 2>&1 systemctl stop fcoe.service
/sbin/chkconfig --del fcoe systemctl disable fcoe.service
fi fi
%postun %postun
if [ "$1" -ge "1" ]; then if [ $1 -ge 1 ]; then
/sbin/service fcoe condrestart > /dev/null 2>&1 || : systemctl try-restart fcoe.service
fi fi
%files %files
%defattr(-,root,root,-)
%doc README COPYING quickstart.txt %doc README COPYING quickstart.txt
%{_sbindir}/* %{_sbindir}/*
%{_mandir}/man8/* %{_mandir}/man8/*
%{_unitdir}/fcoe.service
%config(noreplace) %{_sysconfdir}/sysconfig/fcoe
%dir %{_sysconfdir}/fcoe/ %dir %{_sysconfdir}/fcoe/
%config(noreplace) %{_sysconfdir}/fcoe/config
%config(noreplace) %{_sysconfdir}/fcoe/cfg-ethx %config(noreplace) %{_sysconfdir}/fcoe/cfg-ethx
%dir %{_sysconfdir}/bash_completion.d/ %dir %{_sysconfdir}/bash_completion.d/
%{_sysconfdir}/bash_completion.d/* %{_sysconfdir}/bash_completion.d/*
%{_initrddir}/fcoe
%attr(0755,root,root) %{_libexecdir}/fcoe/fcoe_edd.sh %attr(0755,root,root) %{_libexecdir}/fcoe/fcoe_edd.sh
%attr(0755,root,root) %{_libexecdir}/fcoe/fcoe-setup.sh %attr(0755,root,root) %{_libexecdir}/fcoe/fcoe-setup.sh
%attr(0755,root,root) %{_libexecdir}/fcoe/fcc.sh %attr(0755,root,root) %{_libexecdir}/fcoe/fcc.sh
@ -105,6 +94,11 @@ fi
%changelog %changelog
* Mon Jul 18 2011 Petr Sabata <contyk@redhat.com> - 1.0.20-2
- Drop SysV support in favor of systemd (#714683)
- Remove ancient scriptlets (pre-1.0.7 era)
- Update quickstart.txt to reflect new changes
* Thu Jul 07 2011 Petr Sabata <contyk@redhat.com> - 1.0.20-1 * Thu Jul 07 2011 Petr Sabata <contyk@redhat.com> - 1.0.20-1
- 1.0.20 bump - 1.0.20 bump
@ -189,7 +183,7 @@ fi
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Tue Jun 9 2009 Jan Zeleny <jzeleny@redhat.com> - 1.0.7-7 * Tue Jun 9 2009 Jan Zeleny <jzeleny@redhat.com> - 1.0.7-7
- added quickstart file to %doc (#500759) - added quickstart file to doc (#500759)
* Thu May 14 2009 Jan Zeleny <jzeleny@redhat.com> - 1.0.7-6 * Thu May 14 2009 Jan Zeleny <jzeleny@redhat.com> - 1.0.7-6
- renamed init script to fcoe, changed lock filename to fcoe - renamed init script to fcoe, changed lock filename to fcoe

5
fcoe.config Normal file
View File

@ -0,0 +1,5 @@
# All supported drivers listed here are loaded when service starts
SUPPORTED_DRIVERS="libfc fcoe"
# Add --debug to enable debug messages
FCOEMON_OPTS="--syslog"

13
fcoe.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=Open-FCoE Inititator.
After=syslog.target network.target lldpad.service
[Service]
Type=forking
PIDFile=/var/run/fcoemon.pid
EnvironmentFile=/etc/sysconfig/fcoe
ExecStartPre=/sbin/modprobe -qa $SUPPORTED_DRIVERS
ExecStart=/usr/sbin/fcoemon $FCOEMON_OPTS
[Install]
WantedBy=multi-user.target

View File

@ -11,16 +11,15 @@ Quick Start guide for Open-FCoE
3. Modify configuration files to enable FCoE. Set FCOE_ENABLE="yes" and 3. Modify configuration files to enable FCoE. Set FCOE_ENABLE="yes" and
DCB_REQUIRED="yes". DCB_REQUIRED="yes".
3. Run 'chkconfig fcoe on' to start FCoE per run level. This will setup 3. Run 'systemctl enable fcoe.service' to start FCoE per run level. This
FCoE to start on reboot. will setup FCoE to start on reboot.
4. Run 'chkconfig dcbd on' to start DCB per run level. This will setup DCB to 4. Run 'systemctl enable lldpad.service' to start LLDP agent per run
start on reboot. level. This will setup DCB to start on reboot.
5. Run 'service dcbd start' to start dcb. 5. Run 'systemctl start lldpad.service' to start LLDP agent.
6. Run 'dcbtool sc ethX dcb on; dcbtool sc ethX app:0 e:1;' for each fcoe-enabled 6. Run 'dcbtool sc ethX dcb on; dcbtool sc ethX app:0 e:1;' for each fcoe-enabled
interface to setup dcb for fcoe. interface to setup DCB for FCoE.
7. Run 'service fcoe start' to start fcoe.
7. Run 'systemctl start fcoe.sertvice' to start FCoE.