Blame SOURCES/nfs-utils-2.3.3-remove-osd_login.patch

c88dcf
commit 80b17639d78e152306d8d1753d719654ebb40e01
c88dcf
Author: Steve Dickson <steved@redhat.com>
c88dcf
Date:   Fri Oct 19 10:26:10 2018 -0400
c88dcf
c88dcf
    Remove osd_login
c88dcf
    
c88dcf
    This ancient script has not been used
c88dcf
    in years, if used at all.
c88dcf
    
c88dcf
    Signed-off-by: Steve Dickson <steved@redhat.com>
c88dcf
c88dcf
diff --git a/configure.ac b/configure.ac
c88dcf
index e82ff14..cf1c4b9 100644
c88dcf
--- a/configure.ac
c88dcf
+++ b/configure.ac
c88dcf
@@ -238,13 +238,6 @@ AC_ARG_ENABLE(nfsdcltrack,
c88dcf
 	enable_nfsdcltrack=$enableval,
c88dcf
 	enable_nfsdcltrack="yes")
c88dcf
 
c88dcf
-AC_ARG_ENABLE(osdlogin,
c88dcf
-	[AC_HELP_STRING([--enable-osdlogin],
c88dcf
-			[enable osd_login scripts @<:@default=no@:>@])],
c88dcf
-	enable_osdlogin=$enableval,
c88dcf
-	enable_osdlogin="no")
c88dcf
-	AM_CONDITIONAL(CONFIG_OSD_LOGIN, [test "$enable_osdlogin" = "yes" ])
c88dcf
-
c88dcf
 dnl Check for TI-RPC library and headers
c88dcf
 AC_LIBTIRPC
c88dcf
 
c88dcf
@@ -631,7 +624,6 @@ AC_CONFIG_FILES([
c88dcf
 	utils/nfsidmap/Makefile
c88dcf
 	utils/showmount/Makefile
c88dcf
 	utils/statd/Makefile
c88dcf
-	utils/osd_login/Makefile
c88dcf
 	systemd/Makefile
c88dcf
 	tests/Makefile
c88dcf
 	tests/nsm_client/Makefile])
c88dcf
diff --git a/utils/Makefile.am b/utils/Makefile.am
c88dcf
index d361aea..0a5b062 100644
c88dcf
--- a/utils/Makefile.am
c88dcf
+++ b/utils/Makefile.am
c88dcf
@@ -34,7 +34,6 @@ SUBDIRS = \
c88dcf
 	nfsstat \
c88dcf
 	showmount \
c88dcf
 	statd \
c88dcf
-	osd_login \
c88dcf
 	$(OPTDIRS)
c88dcf
 
c88dcf
 MAINTAINERCLEANFILES = Makefile.in
c88dcf
diff --git a/utils/osd_login/Makefile.am b/utils/osd_login/Makefile.am
c88dcf
deleted file mode 100644
c88dcf
index ded1fd3..0000000
c88dcf
--- a/utils/osd_login/Makefile.am
c88dcf
+++ /dev/null
c88dcf
@@ -1,9 +0,0 @@
c88dcf
-## Process this file with automake to produce Makefile.in
c88dcf
-
c88dcf
-# These binaries go in /sbin (not /usr/sbin), and that cannot be
c88dcf
-# overridden at config time.
c88dcf
-sbindir = /sbin
c88dcf
-
c88dcf
-dist_sbin_SCRIPTS = osd_login
c88dcf
-
c88dcf
-MAINTAINERCLEANFILES = Makefile.in
c88dcf
diff --git a/utils/osd_login/osd_login b/utils/osd_login/osd_login
c88dcf
deleted file mode 100644
c88dcf
index 08cd2d2..0000000
c88dcf
--- a/utils/osd_login/osd_login
c88dcf
+++ /dev/null
c88dcf
@@ -1,118 +0,0 @@
c88dcf
-#!/bin/bash
c88dcf
-#
c88dcf
-# osd_login : This script is part of the autologin feature
c88dcf
-#             mandated by the pnfs-objects standard.
c88dcf
-# It is called from objlayoutdriver.ko in the kernel.
c88dcf
-
c88dcf
-# Copyright (C) 2012, Sachin Bhamare <sbhamare@panasas.com>
c88dcf
-# Copyright (C) 2012, Boaz Harrosh <bharrosh@panasas.com>
c88dcf
-#
c88dcf
-# This program is free software; you can redistribute it and/or modify
c88dcf
-# it under the terms of the GNU General Public License version 2 as
c88dcf
-# published by the Free Software Foundation.
c88dcf
-#
c88dcf
-# This program is distributed in the hope that it will be useful,
c88dcf
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
c88dcf
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c88dcf
-# GNU General Public License for more details.
c88dcf
-#
c88dcf
-# You should have received a copy of the GNU General Public License
c88dcf
-# along with this program; if not, write to the Free Software
c88dcf
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
c88dcf
-# MA 02110-1301 USA
c88dcf
-
c88dcf
-umask 022
c88dcf
-
c88dcf
-PATH="/sbin:/usr/sbin:/bin:/usr/bin"
c88dcf
-
c88dcf
-iscsiadm=/sbin/iscsiadm
c88dcf
-
c88dcf
-PARENT_PID=$BASHPID
c88dcf
-WATCHDOG_TIMEOUT=15
c88dcf
-
c88dcf
-protocol=""
c88dcf
-portal=""
c88dcf
-uri=""
c88dcf
-osdname=""
c88dcf
-systemid=""
c88dcf
-
c88dcf
-usage()
c88dcf
-{
c88dcf
-	echo "Usage: $0 -u <URI> -o <OSDNAME> -s <SYSTEMID>"
c88dcf
-	echo "Options:"
c88dcf
-	echo  "-u		target uri e.g. iscsi://<ip>:<port>"
c88dcf
-	echo  "-o		osdname of the target OSD"
c88dcf
-	echo  "-s		systemid of the target OSD"
c88dcf
-}
c88dcf
-
c88dcf
-parse_cmdline()
c88dcf
-{
c88dcf
-	argc=$#
c88dcf
-	if [ $# -lt 3 ]; then
c88dcf
-		usage
c88dcf
-		exit 1
c88dcf
-	fi
c88dcf
-
c88dcf
-	# parse the input arguments
c88dcf
-	while getopts "u:o:s:" options; do
c88dcf
-	    case $options in
c88dcf
-		u ) uri=$OPTARG;;
c88dcf
-		o ) osdname=$OPTARG;;
c88dcf
-		s ) systemid=$OPTARG;;
c88dcf
-		\? ) usage
c88dcf
-			exit 1;;
c88dcf
-		* )  usage
c88dcf
-			exit 1;;
c88dcf
-	    esac
c88dcf
-	done
c88dcf
-
c88dcf
-	echo "-u : $uri"
c88dcf
-	echo "-o : $osdname"
c88dcf
-	echo "-s : $systemid"
c88dcf
-
c88dcf
-	protocol=`echo $uri | awk -F ':' '{print $1}'`
c88dcf
-	portal=`echo $uri | awk -F '//' '{print $2}'`
c88dcf
-}
c88dcf
-
c88dcf
-watchdog()
c88dcf
-{
c88dcf
-	timeout=$1
c88dcf
-	portal=$2
c88dcf
-
c88dcf
-	sleep $timeout
c88dcf
-	if kill -9 $PARENT_PID; then
c88dcf
-	    echo "watchdog : Timed out (>$timeout seconds) while login into $portal" | logger -t "osd_login"
c88dcf
-	fi
c88dcf
-	echo "watchdog: exiting .."
c88dcf
-	exit 2
c88dcf
-}
c88dcf
-
c88dcf
-login_iscsi_osd()
c88dcf
-{
c88dcf
-	echo "login into: $1"
c88dcf
-	if ! $iscsiadm -m discovery -o nonpersistent -t sendtargets -p $1 --login; then
c88dcf
-		echo "$iscsiadm -m discovery -t sendtargets -p $1 --login returned error $? !"
c88dcf
-		sleep 1;
c88dcf
-	fi
c88dcf
-}
c88dcf
-
c88dcf
-echo "============= osd_login ========="
c88dcf
-echo "progname : $0"
c88dcf
-parse_cmdline "$@"
c88dcf
-echo "protocol: $protocol"
c88dcf
-echo "portal: $portal"
c88dcf
-
c88dcf
-watchdog $WATCHDOG_TIMEOUT $portal &
c88dcf
-watchdog_pid=$!
c88dcf
-
c88dcf
-case $protocol in
c88dcf
-iscsi)
c88dcf
-	login_iscsi_osd $portal |& logger -t "osd_login"
c88dcf
-	;;
c88dcf
-*)
c88dcf
-	echo "Error: protocol $protocol not supported !" | logger -t "osd_login"
c88dcf
-	;;
c88dcf
-esac
c88dcf
-
c88dcf
-kill -9 $watchdog_pid
c88dcf
-exit 0