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

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