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

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