Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 649338 Details for
Bug 714688
Provide native systemd unit file
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Systemd patch with iscsi pre shutdown check
systemd.diff (text/plain), 26.30 KB, created by
Jóhann B. Guðmundsson
on 2012-11-21 18:28:26 UTC
(
hide
)
Description:
Systemd patch with iscsi pre shutdown check
Filename:
MIME Type:
Creator:
Jóhann B. Guðmundsson
Created:
2012-11-21 18:28:26 UTC
Size:
26.30 KB
patch
obsolete
>From 2bf4367ae790ee7d700da08d841d5bafcafd3d5c Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?"J=C3=B3hann=20B.=20Gu=C3=B0mundsson"?= > <johannbg@fedoraproject.org> >Date: Mon, 19 Nov 2012 22:40:38 +0000 >Subject: [PATCH 01/10] Introducing native systemd units > >--- > iscsi.service | 17 +++++++++++++++++ > iscsid.service | 13 +++++++++++++ > iscsiuio.service | 15 +++++++++++++++ > 3 files changed, 45 insertions(+) > create mode 100644 iscsi.service > create mode 100644 iscsid.service > create mode 100644 iscsiuio.service > >diff --git a/iscsi.service b/iscsi.service >new file mode 100644 >index 0000000..2a7a61e >--- /dev/null >+++ b/iscsi.service >@@ -0,0 +1,17 @@ >+[Unit] >+Description=Login and scanning of iSCSI devices >+Documentation=man:iscsiadm(8) man:iscsid(8) >+Requires=iscsid.service >+BindTo=iscsid.service >+After=network.target NetworkManager-wait-online.service iscsid.service >+ConditionPathExists=/etc/iscsi/initiatorname.iscsi >+ >+[Service] >+Type=oneshot >+ExecStart=/sbin/iscsiadm -m node --loginall=automatic >+ExecStop=/bin/sync >+ExecStop=/sbin/iscsiadm -m node --logoutall=automatic >+RemainAfterExit=true >+ >+[Install] >+WantedBy=multi-user.target >diff --git a/iscsid.service b/iscsid.service >new file mode 100644 >index 0000000..9b12b7b >--- /dev/null >+++ b/iscsid.service >@@ -0,0 +1,13 @@ >+[Unit] >+Description=Open-iSCSI >+Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8) >+After=network.target NetworkManager-wait-online.service iscsiuio.service tgtd.service, please Add=targetcli.service >+ >+[Service] >+Type=forking >+PIDFile=/var/run/iscsid.pid >+ExecStart=/usr/sbin/iscsid >+ExecStop=/sbin/iscsiadm -k 0 2 >+ >+[Install] >+WantedBy=multi-user.target >diff --git a/iscsiuio.service b/iscsiuio.service >new file mode 100644 >index 0000000..5dedcef >--- /dev/null >+++ b/iscsiuio.service >@@ -0,0 +1,15 @@ >+[Unit] >+Description=iSCSI UserSpace I/O driver >+Documentation=man:iscsiuio(8) man:iscsid(8) >+Requires=iscsid.service >+BindTo=iscsid.service >+Before=iscsid.service >+After=network.target NetworkManager-wait-online.service >+ >+[Service] >+Type=forking >+PIDFile=/var/run/iscsiuio.pid >+ExecStart=/usr/sbin/iscsiuio >+ >+[Install] >+WantedBy=multi-user.target >-- >1.7.11.7 > > >From e94607d5695d1526fa53c8f08d160ed664c6b0a6 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?"J=C3=B3hann=20B.=20Gu=C3=B0mundsson"?= > <johannbg@fedoraproject.org> >Date: Mon, 19 Nov 2012 22:41:33 +0000 >Subject: [PATCH 02/10] Adding changes to spec file for native systemd units > >--- > iscsi-initiator-utils.spec | 62 +++++++++++++++++++++++++++------------------- > 1 file changed, 37 insertions(+), 25 deletions(-) > >diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec >index 3cb86be..8268e85 100644 >--- a/iscsi-initiator-utils.spec >+++ b/iscsi-initiator-utils.spec >@@ -3,11 +3,12 @@ > Summary: iSCSI daemon and utility programs > Name: iscsi-initiator-utils > Version: 6.2.0.872 >-Release: 19%{?dist} >+Release: 20%{?dist} > Source0: http://people.redhat.com/mchristi/iscsi/rhel6.0/source/open-iscsi-2.0-872-rc4-bnx2i.tar.gz >-Source1: iscsid.init >-Source2: iscsidevs.init >-Source3: 04-iscsi >+Source1: iscsid.service >+Source2: iscsi.service >+Source3: iscsiuio.service >+Source4: 04-iscsi > # sync brcm to 0.7.0.12 > Patch0: iscsi-initiator-utils-sync-uio-0.7.0.8.patch > # sync iscsi tools to upstream commit e8c5b1d34ee5ce0a755ff54518829156dfa5fabe >@@ -54,9 +55,9 @@ URL: http://www.open-iscsi.org > Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) > BuildRequires: openssl-devel flex bison python-devel doxygen glibc-static > # For dir ownership >-Requires: initscripts >-Requires(post): chkconfig >-Requires(preun): chkconfig /sbin/service >+Requires(post): systemd >+Requires(preun): systemd >+Requires(postun): systemd > > %description > The iscsi package provides the server daemon for the iSCSI protocol, >@@ -122,7 +123,6 @@ popd > rm -rf $RPM_BUILD_ROOT > mkdir -p $RPM_BUILD_ROOT/sbin > mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8 >-mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d > mkdir -p $RPM_BUILD_ROOT/etc/iscsi > mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d > mkdir -p $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d >@@ -150,9 +150,10 @@ install -p -m 644 iscsiuio/docs/iscsiuio.8 $RPM_BUILD_ROOT/%{_mandir}/man8 > install -p -m 644 iscsiuio/iscsiuiolog $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d > install -p -m 755 iscsiuio/src/unix/iscsiuio $RPM_BUILD_ROOT/sbin > >-install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/iscsid >-install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/iscsi >-install -p -m 755 %{SOURCE3} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d >+install -p -D -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/iscsid.service >+install -p -D -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/iscsi.service >+install -p -D -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/iscsiuio.service >+install -p -m 755 %{SOURCE4} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d > > install -p -m 755 libiscsi/libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir} > ln -s libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}/libiscsi.so >@@ -174,9 +175,10 @@ if [ "$1" -eq "1" ]; then > if [ ! -f %{_sysconfdir}/iscsi/initiatorname.iscsi ]; then > echo "InitiatorName=`/sbin/iscsi-iname`" > %{_sysconfdir}/iscsi/initiatorname.iscsi > fi >- /sbin/chkconfig --add iscsid >- /sbin/chkconfig --add iscsi > fi >+ >+%systemd_post iscsid.service iscsi.service iscsiuio.service >+ > # To make sure iscsid autostart works when upgrading from a version which > # did not have this in its config file > if ! grep -q 'iscsid\.startup' %{_sysconfdir}/iscsi/iscsid.conf; then >@@ -186,18 +188,24 @@ if ! grep -q 'iscsid\.startup' %{_sysconfdir}/iscsi/iscsid.conf; then > fi > > %postun -p /sbin/ldconfig >+%systemd_postun > > %preun >-if [ "$1" = "0" ]; then >- # stop iscsi >- /sbin/service iscsi stop > /dev/null 2>&1 >- # delete service >- /sbin/chkconfig --del iscsi >- # stop iscsid >- /sbin/service iscsid stop > /dev/null 2>&1 >- # delete service >- /sbin/chkconfig --del iscsid >-fi >+%systemd_preunt iscsid.service iscsi.service iscsiuio.service >+ >+%triggerun -- iscsi-initiator-utils < 6.2.0.872-20 >+# Save the current service runlevel info >+# User must manually run systemd-sysv-convert --apply iscsid >+# and systemd-sysv-convert --apply iscsi >+# to migrate them to systemd targets >+/usr/bin/systemd-sysv-convert --save iscsi >/dev/null 2>&1 ||: >+/usr/bin/systemd-sysv-convert --save iscsid >/dev/null 2>&1 ||: >+ >+# Run these because the SysV package being removed won't do them >+/sbin/chkconfig --del iscsid >/dev/null 2>&1 || : >+/sbin/chkconfig --del iscsi >/dev/null 2>&1 || : >+/bin/systemctl try-restart iscsid.service >/dev/null 2>&1 || : >+/bin/systemctl try-restart iscsi.service >/dev/null 2>&1 || : > > %files > %defattr(-,root,root) >@@ -211,8 +219,9 @@ fi > %dir %{_var}/lib/iscsi/send_targets > %ghost %{_var}/lock/iscsi > %ghost %{_var}/lock/iscsi/lock >-%{_initrddir}/iscsi >-%{_initrddir}/iscsid >+%{_unitdir}/iscsid.service >+%{_unitdir}/iscsi.service >+%{_unitdir}/iscsiuio.service > %{_sysconfdir}/NetworkManager/dispatcher.d/04-iscsi > %dir %{_sysconfdir}/iscsi > %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/iscsi/iscsid.conf >@@ -229,6 +238,9 @@ fi > %{_includedir}/libiscsi.h > > %changelog >+* Mon Nov 19 2012 Jóhann B. Guðmundsson <johannbg@fedoraproject.org> - 6.2.0.872-20 >+- Inital systemd support >+ > * Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.0.872-19 > - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild > >-- >1.7.11.7 > > >From 438701e5fdfb9e8c94def348211642b48235ceed Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?"J=C3=B3hann=20B.=20Gu=C3=B0mundsson"?= > <johannbg@fedoraproject.org> >Date: Mon, 19 Nov 2012 22:42:20 +0000 >Subject: [PATCH 03/10] New nm dispatcher script which uses systemctl for > iscsi > >--- > 04-iscsi | 20 +++++--------------- > 1 file changed, 5 insertions(+), 15 deletions(-) > >diff --git a/04-iscsi b/04-iscsi >index 58aa798..ba7cd7d 100755 >--- a/04-iscsi >+++ b/04-iscsi >@@ -1,17 +1,7 @@ > #!/bin/sh > >-export LC_ALL=C >- >-if [ "$2" = "down" ]; then >- if ! /sbin/ip route ls | grep -q ^default && >- [ -f /var/lock/subsys/iscsi ]; then >- /etc/rc.d/init.d/iscsi stop >- fi >-fi >- >-if [ "$2" = "up" ]; then >- if /sbin/ip -o route show dev "$1" | grep -q '^default' && >- /sbin/chkconfig iscsi; then >- /etc/rc.d/init.d/iscsi start >- fi >-fi >+case "$2" in >+ up|down|vpn-up|vpn-down) >+ /bin/systemctl try-restart iscsi.service || : >+ ;; >+esac >-- >1.7.11.7 > > >From 4eb5795fb51f25bda45a777b8e914d75df69067f Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?"J=C3=B3hann=20B.=20Gu=C3=B0mundsson"?= > <johannbg@fedoraproject.org> >Date: Mon, 19 Nov 2012 22:42:57 +0000 >Subject: [PATCH 04/10] Removing legacy sysv init scripts > >--- > iscsid.init | 183 --------------------------------------------------------- > iscsidevs.init | 169 ---------------------------------------------------- > 2 files changed, 352 deletions(-) > delete mode 100755 iscsid.init > delete mode 100755 iscsidevs.init > >diff --git a/iscsid.init b/iscsid.init >deleted file mode 100755 >index 92912f2..0000000 >--- a/iscsid.init >+++ /dev/null >@@ -1,183 +0,0 @@ >-#!/bin/sh >-# >-# iscsid iSCSI daemon >-# >-# chkconfig: 345 7 89 >-# description: Starts and stops the iSCSI daemon. >-# >-# processname: iscsid >-# pidfile: /var/run/iscsid.pid >-# config: /etc/iscsi/iscsid.conf >- >-### BEGIN INIT INFO >-# Provides: iscsid >-# Default-Start: 3 4 5 >-# Default-Stop: 0 1 2 6 >-# Short-Description: Starts and stops login iSCSI daemon. >-# Description: iscsid provides the iSCSI session and connection state machine >-# for software iscsi/iser (iscsi_tcp/ib_iser) and partialy >-# offloaded hardware (bnx2i). >-### END INIT INFO >- >-# Source function library. >-. /etc/rc.d/init.d/functions >- >-exec=/sbin/iscsid >-prog=iscsid >-config=/etc/iscsi/iscsid.conf >-lockfile=/var/lock/subsys/$prog >-iscsi_lockfile=/var/lock/subsys/iscsi >- >-# FIXME this has a false positive for root on nfs >-root_is_iscsi() { >- rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab) >- [[ "$rootopts" =~ "_netdev" ]] >-} >- >-start_iscsid() { >- echo -n $"Starting $prog: " >- modprobe -q iscsi_tcp >- modprobe -q ib_iser >- modprobe -q cxgb3i >- modprobe -q cxgb4i >- modprobe -q bnx2i >- modprobe -q be2iscsi >- daemon iscsiuio >- daemon $prog >- retval=$? >- echo >- touch $lockfile >-} >- >-force_start() { >- start_iscsid >- # a force start could imply the iscsi service is started due to how it >- # lazy starts. We need to touch the lock file so it is shutdown later >- touch $iscsi_lockfile >-} >- >-use_discoveryd() { >- grep -qrs "discovery.sendtargets.use_discoveryd = Yes" /var/lib/iscsi/send_targets >- if [ $? -eq 0 ] ; then >- return 0 >- fi >- >- grep -qrs "discovery.isns.use_discoveryd = Yes" /var/lib/iscsi/isns >- if [ $? -eq 0 ] ; then >- return 0 >- fi >- >- return 1 >-} >- >-start() { >- [ -x $exec ] || exit 5 >- [ -f $config ] || exit 6 >- >- start_iscsid >- return $? >-} >- >-stop() { >- if use_discoveryd ; then >- iscsiadm -k 0 2>/dev/null >- fi >- >- declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|cxgb3i|cxgb4i|be2iscsi") ) >- if [[ -n "${iparams[*]}" ]]; then >- # We have active sessions, so don't stop iscsid!! >- echo -n $"Not stopping $prog: iscsi sessions still active" >- warning $"Not stopping $prog: iscsi sessions still active" >- echo >- return 0 >- fi >- >- echo -n $"Stopping $prog: " >- >- iscsiadm -k 0 2>/dev/null >- echo >- >- killproc iscsiuio >- rm -f /var/run/iscsiuio.pid >- >- # only remove the iscsi drivers when offload is used >- rmmod bnx2i 2>/dev/null >- rmmod cnic 2>/dev/null >- >- rmmod cxgb3i 2>/dev/null >- rmmod cxgb4i 2>/dev/null >- >- # a bug in kobject netlink code will cause this to oops >- # modprobe -r be2iscsi 2>/dev/null >- >- modprobe -r ib_iser 2>/dev/null >- modprobe -r iscsi_tcp 2>/dev/null >- >- rm -f $lockfile >- return 0 >-} >- >-rh_status_q() { >- rh_status >/dev/null 2>&1 >-} >- >-restart() { >- rh_status_q >- use_force_start=$? >- >- stop >- # if iscsid was running then make sure it starts up >- if [ "$use_force_start" -eq 0 ] ; then >- start_iscsid >- else >- start >- fi >-} >- >-reload() { >- return 3 >-} >- >-force_reload() { >- restart >-} >- >-rh_status() { >- status $prog >-} >- >-case "$1" in >- start) >- rh_status_q && exit 0 >- $1 >- ;; >- force-start) >- force_start >- ;; >- stop) >- rh_status_q || exit 0 >- $1 >- ;; >- restart) >- $1 >- ;; >- reload) >- rh_status_q || exit 7 >- $1 >- ;; >- force-reload) >- force_reload >- ;; >- status) >- rh_status >- ;; >- condrestart|try-restart) >- rh_status_q || exit 0 >- restart >- ;; >- *) >- echo $"Usage: $0 >-{start|stop|status|restart|condrestart|try-restart|reload|force-reload}" >- exit 2 >-esac >-exit $? >diff --git a/iscsidevs.init b/iscsidevs.init >deleted file mode 100755 >index 60498c4..0000000 >--- a/iscsidevs.init >+++ /dev/null >@@ -1,169 +0,0 @@ >-#!/bin/sh >-# >-# iscsi: log into iSCSI targets >-# >-# chkconfig: 345 13 89 >-# description: Logs into iSCSI targets needed at system startup >- >-### BEGIN INIT INFO >-# Provides: iscsi >-# Required-Start: iscsid network >-# Should-Start: tgtd >-# Required-Stop: iscsid >-# Should-Stop: tgtd >-# Default-Start: 3 4 5 >-# Default-Stop: 0 1 2 6 >-# Short-Description: Starts and stops login and scanning of iSCSI devices. >-# Description: iscsi provides the iSCSI state machine for software iscsi/iser >-# and partial offloaded hardware. iscsi logs into and scans >-# for iSCSI devices, and shuts them down when stopped. >-### END INIT INFO >- >-# Source function library. >-. /etc/rc.d/init.d/functions >- >-exec="/sbin/iscsiadm" >-prog="iscsi" >-config="/etc/iscsi/initiatorname.iscsi" >-lockfile=/var/lock/subsys/$prog >-iscsid_lockfile=/var/lock/subsys/${prog}_iscsid >- >-start() { >- [ -x $exec ] || exit 5 >- [ -f $config ] || exit 6 >- >- # if the network isn't up yet exit cleanly, NetworkManager will call us >- # again when the network is up >- [ ! -f /var/lock/subsys/network ] && ! nm-online -x >/dev/null 2>&1 && exit 3 >- >- # this script is normally called from startup so log into >- # nodes marked node.startup=automatic >- echo -n $"Starting $prog: " >- $exec -m node --loginall=automatic 2>&1 > /dev/null | grep iscsiadm >- # Ignore return code, because this command attempts to log into >- # multiple sessions and some sessions could get logged into and >- # some could be down temporarily. >- success $"Starting $prog" >- touch $lockfile >- echo >- return 0 >-} >- >-iscsi_sessions_running() { >- declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i|cxgb4i") ) >- if [[ -z "${iparams[*]}" ]]; then >- # no sessions >- return 2 >- fi >- >- return 0 >-} >- >-cleanup_successful_stop() { >- success $"Stopping $prog" >- rm -f $lockfile >- echo >-} >- >-stop() { >- # Don't turn off iscsi if root is possibly on a iscsi disk. >- rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab) >- if [[ "$rootopts" =~ "_netdev" ]] ; then >- echo $"Can not shutdown iSCSI. Root is on a iSCSI disk." >- >- # Just clean up lock file if this is a system shutdown/reboot. >- if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then >- rm -f $lockfile >- fi >- >- exit 1 >- fi >- >- echo -n $"Stopping $prog: " >- >- if ! iscsi_sessions_running ; then >- cleanup_successful_stop >- return 0 >- fi >- >- if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then >- $exec -m node --logoutall=all 2>&1 > /dev/null >- else >- $exec -m node --logoutall=automatic 2>&1 > /dev/null >- fi >- >- ret=$? >- # ignore ISCSI_ERR_NO_OBJS_FOUND/21 >- if [[ "$ret" -ne 0 && "$ret" -ne 21 ]]; then >- failure $"Stopping $prog" >- echo >- return 1 >- fi >- >- cleanup_successful_stop >- return 0 >-} >- >-restart() { >- stop >- start >-} >- >-reload() { >- return 3 >-} >- >-force_reload() { >- restart >-} >- >-rh_status() { >- [ -f $lockfile ] || { echo $"$prog is stopped" ; return 3 ; } >- >- declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i|cxgb4i") ) >- if [[ -z "${iparams[*]}" ]]; then >- # no sessions >- echo $"No active sessions" >- return 2 >- fi >- >- iscsiadm -m session -P 3 >- return 0 >-} >- >-rh_status_q() { >- rh_status >/dev/null 2>&1 >-} >- >- >-case "$1" in >- start) >- rh_status_q && exit 0 >- $1 >- ;; >- stop) >- $1 >- ;; >- restart) >- $1 >- ;; >- reload) >- rh_status_q || exit 7 >- $1 >- ;; >- force-reload) >- force_reload >- ;; >- status) >- rh_status >- ;; >- condrestart|try-restart) >- rh_status_q || exit 0 >- restart >- ;; >- *) >- echo $"Usage: $0 >-{start|stop|status|restart|condrestart|try-restart|reload|force-reload}" >- exit 2 >-esac >-exit $? >-- >1.7.11.7 > > >From c3316803e732f2323b2b8568af973adeaff317d5 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?"J=C3=B3hann=20B.=20Gu=C3=B0mundsson"?= > <johannbg@fedoraproject.org> >Date: Mon, 19 Nov 2012 23:25:57 +0000 >Subject: [PATCH 05/10] Adding modules-load file > >--- > iscsi-initiator-utils.spec | 5 ++++- > iscsid.conf | 7 +++++++ > 2 files changed, 11 insertions(+), 1 deletion(-) > create mode 100644 iscsid.conf > >diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec >index 8268e85..96648e5 100644 >--- a/iscsi-initiator-utils.spec >+++ b/iscsi-initiator-utils.spec >@@ -9,6 +9,7 @@ Source1: iscsid.service > Source2: iscsi.service > Source3: iscsiuio.service > Source4: 04-iscsi >+Source5: iscsid.conf > # sync brcm to 0.7.0.12 > Patch0: iscsi-initiator-utils-sync-uio-0.7.0.8.patch > # sync iscsi tools to upstream commit e8c5b1d34ee5ce0a755ff54518829156dfa5fabe >@@ -137,7 +138,7 @@ mkdir -p $RPM_BUILD_ROOT/var/lock/iscsi > mkdir -p $RPM_BUILD_ROOT%{_libdir} > mkdir -p $RPM_BUILD_ROOT%{_includedir} > mkdir -p $RPM_BUILD_ROOT%{python_sitearch} >- >+mkdir -p $RPM_BUILD_ROOT/lib/modules-load.d/ > > > install -p -m 755 usr/iscsid usr/iscsiadm utils/iscsi-iname usr/iscsistart $RPM_BUILD_ROOT/sbin >@@ -154,6 +155,7 @@ install -p -D -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/iscsid.service > install -p -D -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/iscsi.service > install -p -D -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/iscsiuio.service > install -p -m 755 %{SOURCE4} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d >+install -p -D -m 644 %{SOURCE5} $RPM_BUILD_ROOT/lib/modules-load.d/iscsid.conf > > install -p -m 755 libiscsi/libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir} > ln -s libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}/libiscsi.so >@@ -223,6 +225,7 @@ fi > %{_unitdir}/iscsi.service > %{_unitdir}/iscsiuio.service > %{_sysconfdir}/NetworkManager/dispatcher.d/04-iscsi >+/lib/modules-load.d/iscsid.conf > %dir %{_sysconfdir}/iscsi > %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/iscsi/iscsid.conf > /sbin/* >diff --git a/iscsid.conf b/iscsid.conf >new file mode 100644 >index 0000000..faa833e >--- /dev/null >+++ b/iscsid.conf >@@ -0,0 +1,7 @@ >+# Load iscsi modules at boot >+iscsi_tcp >+ib_iser >+cxgb3i >+cxgb4i >+bnx2i >+be2iscsi >-- >1.7.11.7 > > >From 67c42ef0c28c55def8dc9452aea56767bef4629c Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?"J=C3=B3hann=20B.=20Gu=C3=B0mundsson"?= > <johannbg@fedoraproject.org> >Date: Tue, 20 Nov 2012 09:33:57 +0000 >Subject: [PATCH 06/10] Fixing typo caused by lack of caffene also using > %systemd_requires macros which nicely wraps > Requires(post): systemd and similar > >--- > iscsi-initiator-utils.spec | 6 ++---- > iscsid.service | 2 +- > 2 files changed, 3 insertions(+), 5 deletions(-) > >diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec >index 96648e5..5ac0d4c 100644 >--- a/iscsi-initiator-utils.spec >+++ b/iscsi-initiator-utils.spec >@@ -56,9 +56,7 @@ URL: http://www.open-iscsi.org > Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) > BuildRequires: openssl-devel flex bison python-devel doxygen glibc-static > # For dir ownership >-Requires(post): systemd >-Requires(preun): systemd >-Requires(postun): systemd >+%systemd_requires > > %description > The iscsi package provides the server daemon for the iSCSI protocol, >@@ -193,7 +191,7 @@ fi > %systemd_postun > > %preun >-%systemd_preunt iscsid.service iscsi.service iscsiuio.service >+%systemd_preun iscsid.service iscsi.service iscsiuio.service > > %triggerun -- iscsi-initiator-utils < 6.2.0.872-20 > # Save the current service runlevel info >diff --git a/iscsid.service b/iscsid.service >index 9b12b7b..028e0b3 100644 >--- a/iscsid.service >+++ b/iscsid.service >@@ -1,7 +1,7 @@ > [Unit] > Description=Open-iSCSI > Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8) >-After=network.target NetworkManager-wait-online.service iscsiuio.service tgtd.service, please Add=targetcli.service >+After=network.target NetworkManager-wait-online.service iscsiuio.service tgtd.service targetcli.service > > [Service] > Type=forking >-- >1.7.11.7 > > >From 3c7bb9caf9d522a87d38721d3fad17cf79b768f1 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?"J=C3=B3hann=20B.=20Gu=C3=B0mundsson"?= > <johannbg@fedoraproject.org> >Date: Tue, 20 Nov 2012 20:38:01 +0000 >Subject: [PATCH 07/10] Reverting the systemd requires macro since fpc decide > do not want requires to be macroized %foo_requires > >--- > iscsi-initiator-utils.spec | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec >index 5ac0d4c..fa327ca 100644 >--- a/iscsi-initiator-utils.spec >+++ b/iscsi-initiator-utils.spec >@@ -56,7 +56,9 @@ URL: http://www.open-iscsi.org > Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) > BuildRequires: openssl-devel flex bison python-devel doxygen glibc-static > # For dir ownership >-%systemd_requires >+Requires(post): systemd >+Requires(preun): systemd >+Requires(postun): systemd > > %description > The iscsi package provides the server daemon for the iSCSI protocol, >-- >1.7.11.7 > > >From 73f8010753e8d58c00a5192f79d8d297abfd3cf7 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?"J=C3=B3hann=20B.=20Gu=C3=B0mundsson"?= > <johannbg@fedoraproject.org> >Date: Wed, 21 Nov 2012 18:05:55 +0000 >Subject: [PATCH 08/10] Adding pre shutdown checks > >--- > iscsi-pre-shutdown-check | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > create mode 100644 iscsi-pre-shutdown-check > >diff --git a/iscsi-pre-shutdown-check b/iscsi-pre-shutdown-check >new file mode 100644 >index 0000000..da31515 >--- /dev/null >+++ b/iscsi-pre-shutdown-check >@@ -0,0 +1,21 @@ >+#!/bin/bash >+ >+rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab) >+declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|cxgb3i|cxgb4i|be2iscsi") ) >+ >+# Check to see of we are are mount root of netdevice or if sessions are active >+ >+if [[ "$rootopts" =~ "_netdev" ]] ; >+ then >+ echo -n "Can not shutdown iSCSI. Root is on a iSCSI disk!" >+ exit 1 >+ >+elif [[ -n "${iparams[*]}" ]]; >+ then >+ echo -n "Cant shutdown iSCSI Sessions are still active!" >+ exit 1 >+ >+else >+ echo $"Root not on iSCSI disk. No active sessions found shutting down iSCSI" >+ exit 0 >+fi >-- >1.7.11.7 > > >From aa25af21d541521b2a48a6922d65fc1205abb5cb Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?"J=C3=B3hann=20B.=20Gu=C3=B0mundsson"?= > <johannbg@fedoraproject.org> >Date: Wed, 21 Nov 2012 18:06:34 +0000 >Subject: [PATCH 09/10] Adding changes to units for pre shutdown checks > >--- > iscsi.service | 1 + > iscsid.service | 3 ++- > 2 files changed, 3 insertions(+), 1 deletion(-) > >diff --git a/iscsi.service b/iscsi.service >index 2a7a61e..6565b2a 100644 >--- a/iscsi.service >+++ b/iscsi.service >@@ -10,6 +10,7 @@ ConditionPathExists=/etc/iscsi/initiatorname.iscsi > Type=oneshot > ExecStart=/sbin/iscsiadm -m node --loginall=automatic > ExecStop=/bin/sync >+ExecStop=/usr/libexec/iscsi-pre-shutdown-check > ExecStop=/sbin/iscsiadm -m node --logoutall=automatic > RemainAfterExit=true > >diff --git a/iscsid.service b/iscsid.service >index 028e0b3..2e36d3a 100644 >--- a/iscsid.service >+++ b/iscsid.service >@@ -1,12 +1,13 @@ > [Unit] > Description=Open-iSCSI > Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8) >-After=network.target NetworkManager-wait-online.service iscsiuio.service tgtd.service targetcli.service >+After=network.target NetworkManager-wait-online.service iscsiuio.service tgtd.service, please Add=targetcli.service > > [Service] > Type=forking > PIDFile=/var/run/iscsid.pid > ExecStart=/usr/sbin/iscsid >+ExecStop=/usr/libexec/iscsi-pre-shutdown-check > ExecStop=/sbin/iscsiadm -k 0 2 > > [Install] >-- >1.7.11.7 > > >From 9c57cb5bab3353f827a4ae65aba4081716a4cd95 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?"J=C3=B3hann=20B.=20Gu=C3=B0mundsson"?= > <johannbg@fedoraproject.org> >Date: Wed, 21 Nov 2012 18:21:07 +0000 >Subject: [PATCH 10/10] Adding changes to spec file for pre shutdown checks > >--- > iscsi-initiator-utils.spec | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec >index fa327ca..5df787a 100644 >--- a/iscsi-initiator-utils.spec >+++ b/iscsi-initiator-utils.spec >@@ -10,6 +10,7 @@ Source2: iscsi.service > Source3: iscsiuio.service > Source4: 04-iscsi > Source5: iscsid.conf >+Source6: iscsi-pre-shutdown-check > # sync brcm to 0.7.0.12 > Patch0: iscsi-initiator-utils-sync-uio-0.7.0.8.patch > # sync iscsi tools to upstream commit e8c5b1d34ee5ce0a755ff54518829156dfa5fabe >@@ -139,7 +140,7 @@ mkdir -p $RPM_BUILD_ROOT%{_libdir} > mkdir -p $RPM_BUILD_ROOT%{_includedir} > mkdir -p $RPM_BUILD_ROOT%{python_sitearch} > mkdir -p $RPM_BUILD_ROOT/lib/modules-load.d/ >- >+mkdir -p $RPM_BUILD_ROOT%{_libexecdir} > > install -p -m 755 usr/iscsid usr/iscsiadm utils/iscsi-iname usr/iscsistart $RPM_BUILD_ROOT/sbin > install -p -m 644 doc/iscsiadm.8 $RPM_BUILD_ROOT/%{_mandir}/man8 >@@ -156,6 +157,7 @@ install -p -D -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/iscsi.service > install -p -D -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/iscsiuio.service > install -p -m 755 %{SOURCE4} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d > install -p -D -m 644 %{SOURCE5} $RPM_BUILD_ROOT/lib/modules-load.d/iscsid.conf >+install -p -m 755 %{SOURCE6} $RPM_BUILD_ROOT%{_libexecdir}/iscsi-pre-shutdown-check > > install -p -m 755 libiscsi/libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir} > ln -s libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}/libiscsi.so >@@ -226,6 +228,7 @@ fi > %{_unitdir}/iscsiuio.service > %{_sysconfdir}/NetworkManager/dispatcher.d/04-iscsi > /lib/modules-load.d/iscsid.conf >+%{_libexecdir}/iscsi-pre-shutdown-check > %dir %{_sysconfdir}/iscsi > %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/iscsi/iscsid.conf > /sbin/* >-- >1.7.11.7 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 714688
:
510446
|
510465
|
646756
|
646757
|
646758
|
647701
|
647706
|
647707
|
647710
|
647716
|
647717
|
647718
|
647770
|
648180
|
648360
|
648830
| 649338 |
649352