public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-block/tgt/files/
@ 2016-11-27 23:53 Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2016-11-27 23:53 UTC (permalink / raw
  To: gentoo-commits

commit:     1a3287d53e9912ab1033b64fcafdc1c341fd21ef
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 27 23:52:47 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Nov 27 23:52:47 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a3287d5

sys-block/tgt: fix bashisms in init.d script

Also drop old unused init.d scripts.

 sys-block/tgt/files/tgtd              | 125 ---------------------------------
 sys-block/tgt/files/tgtd-1.0.24.confd |   4 --
 sys-block/tgt/files/tgtd-1.0.24.initd | 126 ----------------------------------
 sys-block/tgt/files/tgtd.initd        |  12 ++--
 4 files changed, 6 insertions(+), 261 deletions(-)

diff --git a/sys-block/tgt/files/tgtd b/sys-block/tgt/files/tgtd
deleted file mode 100644
index 0d9d0709..00000000
--- a/sys-block/tgt/files/tgtd
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-TGTD_CONFIG=/etc/tgt/targets.conf
-
-TASK=$1
-
-depend() {
-	need net
-}
-
-start() {
-	ebegin "Starting target framework daemon"
-	ebegin "Starting ${SVCNAME}"
-	# Start tgtd first.
-	start-stop-daemon --start --quiet \
-		--name tgtd \
-		--exec /usr/sbin/tgtd
-	RETVAL=$?
-	if [ "$RETVAL" -ne 0 ] ; then
-	    echo "Could not start tgtd (is tgtd already running?)"
-	    exit 1
-	fi
-	# We need to wait for 1 second before do anything with tgtd
-	sleep 1
-	# Put tgtd into "offline" state until all the targets are configured.
-	# We don't want initiators to (re)connect and fail the connection
-	# if it's not ready
-	tgtadm --op update --mode sys --name State -v offline
-	# Configure the targets.
-	tgt-admin --update ALL -c $TGTD_CONFIG
-	# Put tgtd into "ready" state.
-	tgtadm --op update --mode sys --name State -v ready
-	eend $?
-}
-
-stop() {
-	ebegin "Stopping ${SVCNAME}"
-	ebegin "Stopping target framework daemon"
-	# start-stop-daemon --stop --exec /usr/sbin/tgtd --quiet
-	if [ "$RUNLEVEL" == 0 -o "$RUNLEVEL" == 6 ] ; then
-	    forcedstop
-	fi
-	# Remove all targets. It only removes targets which are not in use.
-	tgt-admin --update ALL -c /dev/null &>/dev/null
-	# tgtd will exit if all targets were removed
-	tgtadm --op delete --mode system &>/dev/null
-	RETVAL=$?
-	if [ "$RETVAL" -eq 107 ] ; then
-	    echo "tgtd is not running"
-	    if [ "$TASK" != "restart" ] ; then
-			exit 1
-		fi
-	elif [ "$RETVAL" -ne 0 ] ; then
-	    echo "Some initiators are still connected - could not stop tgtd"
-	    exit 2
-	fi
-	# echo -n
-	eend $?
-}
-
-forcedstop() {
-	# NOTE: Forced shutdown of the iscsi target may cause data corruption
-	# for initiators that are connected.
-	echo "Force-stopping target framework daemon"
-	# Offline everything first. May be needed if we're rebooting, but
-	# expect the initiators to reconnect cleanly when we boot again
-	# (i.e. we don't want them to reconnect to a tgtd which is still
-	# working, but the target is gone).
-	tgtadm --op update --mode sys --name State -v offline &>/dev/null
-	RETVAL=$?
-	if [ "$RETVAL" -eq 107 ] ; then
-	    echo "tgtd is not running"
-	    if [ "$TASK" != "restart" ] ; then
-			exit 1
-		fi
-	else
-	    tgt-admin --offline ALL
-	    # Remove all targets, even if they are still in use.
-	    tgt-admin --update ALL -c /dev/null -f
-	    # It will shut down tgtd only after all targets were removed.
-	    tgtadm --op delete --mode system
-	    RETVAL=$?
-	    if [ "$RETVAL" -ne 0 ] ; then
-			echo "Failed to shutdown tgtd"
-			exit 1
-	    fi
-	fi
-	echo -n
-}
-
-reload() {
-	echo "Updating target framework daemon configuration"
-	# Update configuration for targets. Only targets which
-	# are not in use will be updated.
-	tgt-admin --update ALL -c $TGTD_CONFIG &>/dev/null
-	RETVAL=$?
-	if [ "$RETVAL" -eq 107 ] ; then
-	    echo "tgtd is not running"
-	    exit 1
-	fi
-}
-
-forcedreload() {
-	echo "Force-updating target framework daemon configuration"
-	# Update configuration for targets, even those in use.
-	tgt-admin --update ALL -f -c $TGTD_CONFIG &>/dev/null
-	RETVAL=$?
-	if [ "$RETVAL" -eq 107 ] ; then
-	    echo "tgtd is not running"
-	    exit 1
-	fi
-}
-
-status() {
-	# Don't name this script "tgtd"...
-	TGTD_PROC=$(ps -C tgtd | grep -c tgtd)
-	if [ "$TGTD_PROC" -eq 2 ] ; then
-	    echo "tgtd is running. Run 'tgt-admin -s' to see detailed target info."
-	else
-	    echo "tgtd is NOT running."
-	fi
-}

diff --git a/sys-block/tgt/files/tgtd-1.0.24.confd b/sys-block/tgt/files/tgtd-1.0.24.confd
deleted file mode 100644
index fd4c098..00000000
--- a/sys-block/tgt/files/tgtd-1.0.24.confd
+++ /dev/null
@@ -1,4 +0,0 @@
-# Here you can specify options that are passed directly to tgt daemon
-TGTD_OPTS=""
-
-# vim: ft=gentoo-conf-d

diff --git a/sys-block/tgt/files/tgtd-1.0.24.initd b/sys-block/tgt/files/tgtd-1.0.24.initd
deleted file mode 100644
index c824c09..00000000
--- a/sys-block/tgt/files/tgtd-1.0.24.initd
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-TGTD_CONFIG=/etc/tgt/targets.conf
-
-TASK=$1
-
-depend() {
-	need net
-}
-
-start() {
-	ebegin "Starting target framework daemon"
-	ebegin "Starting ${SVCNAME}"
-	# Start tgtd first.
-	start-stop-daemon --start --quiet \
-		--name tgtd \
-		--exec /usr/sbin/tgtd -- \
-		${TGTD_OPTS}
-	RETVAL=$?
-	if [ "$RETVAL" -ne 0 ] ; then
-	    echo "Could not start tgtd (is tgtd already running?)"
-	    exit 1
-	fi
-	# We need to wait for 1 second before do anything with tgtd
-	sleep 1
-	# Put tgtd into "offline" state until all the targets are configured.
-	# We don't want initiators to (re)connect and fail the connection
-	# if it's not ready
-	tgtadm --op update --mode sys --name State -v offline
-	# Configure the targets.
-	tgt-admin --update ALL -c $TGTD_CONFIG
-	# Put tgtd into "ready" state.
-	tgtadm --op update --mode sys --name State -v ready
-	eend $?
-}
-
-stop() {
-	ebegin "Stopping ${SVCNAME}"
-	ebegin "Stopping target framework daemon"
-	# start-stop-daemon --stop --exec /usr/sbin/tgtd --quiet
-	if [ "$RUNLEVEL" == 0 -o "$RUNLEVEL" == 6 ] ; then
-	    forcedstop
-	fi
-	# Remove all targets. It only removes targets which are not in use.
-	tgt-admin --update ALL -c /dev/null &>/dev/null
-	# tgtd will exit if all targets were removed
-	tgtadm --op delete --mode system &>/dev/null
-	RETVAL=$?
-	if [ "$RETVAL" -eq 107 ] ; then
-	    echo "tgtd is not running"
-	    if [ "$TASK" != "restart" ] ; then
-			exit 1
-		fi
-	elif [ "$RETVAL" -ne 0 ] ; then
-	    echo "Some initiators are still connected - could not stop tgtd"
-	    exit 2
-	fi
-	# echo -n
-	eend $?
-}
-
-forcedstop() {
-	# NOTE: Forced shutdown of the iscsi target may cause data corruption
-	# for initiators that are connected.
-	echo "Force-stopping target framework daemon"
-	# Offline everything first. May be needed if we're rebooting, but
-	# expect the initiators to reconnect cleanly when we boot again
-	# (i.e. we don't want them to reconnect to a tgtd which is still
-	# working, but the target is gone).
-	tgtadm --op update --mode sys --name State -v offline &>/dev/null
-	RETVAL=$?
-	if [ "$RETVAL" -eq 107 ] ; then
-	    echo "tgtd is not running"
-	    if [ "$TASK" != "restart" ] ; then
-			exit 1
-		fi
-	else
-	    tgt-admin --offline ALL
-	    # Remove all targets, even if they are still in use.
-	    tgt-admin --update ALL -c /dev/null -f
-	    # It will shut down tgtd only after all targets were removed.
-	    tgtadm --op delete --mode system
-	    RETVAL=$?
-	    if [ "$RETVAL" -ne 0 ] ; then
-			echo "Failed to shutdown tgtd"
-			exit 1
-	    fi
-	fi
-	echo -n
-}
-
-reload() {
-	echo "Updating target framework daemon configuration"
-	# Update configuration for targets. Only targets which
-	# are not in use will be updated.
-	tgt-admin --update ALL -c $TGTD_CONFIG &>/dev/null
-	RETVAL=$?
-	if [ "$RETVAL" -eq 107 ] ; then
-	    echo "tgtd is not running"
-	    exit 1
-	fi
-}
-
-forcedreload() {
-	echo "Force-updating target framework daemon configuration"
-	# Update configuration for targets, even those in use.
-	tgt-admin --update ALL -f -c $TGTD_CONFIG &>/dev/null
-	RETVAL=$?
-	if [ "$RETVAL" -eq 107 ] ; then
-	    echo "tgtd is not running"
-	    exit 1
-	fi
-}
-
-status() {
-	# Don't name this script "tgtd"...
-	TGTD_PROC=$(ps -C tgtd | grep -c tgtd)
-	if [ "$TGTD_PROC" -eq 2 ] ; then
-	    echo "tgtd is running. Run 'tgt-admin -s' to see detailed target info."
-	else
-	    echo "tgtd is NOT running."
-	fi
-}

diff --git a/sys-block/tgt/files/tgtd.initd b/sys-block/tgt/files/tgtd.initd
index bf20870..a1934d4 100644
--- a/sys-block/tgt/files/tgtd.initd
+++ b/sys-block/tgt/files/tgtd.initd
@@ -41,13 +41,13 @@ stop() {
 	ebegin "Stopping ${SVCNAME}"
 	ebegin "Stopping target framework daemon"
 	# start-stop-daemon --stop --exec /usr/sbin/tgtd --quiet
-	if [ "$RUNLEVEL" == 0 -o "$RUNLEVEL" == 6 ] ; then
+	if [ "$RUNLEVEL" = 0 -o "$RUNLEVEL" = 6 ] ; then
 	    forcedstop
 	fi
 	# Remove all targets. It only removes targets which are not in use.
-	tgt-admin --update ALL -c /dev/null &>/dev/null
+	tgt-admin --update ALL -c /dev/null >/dev/null 2>&1
 	# tgtd will exit if all targets were removed
-	tgtadm --op delete --mode system &>/dev/null
+	tgtadm --op delete --mode system >/dev/null 2>&1
 	RETVAL=$?
 	if [ "$RETVAL" -eq 107 ] ; then
 	    echo "tgtd is not running"
@@ -70,7 +70,7 @@ forcedstop() {
 	# expect the initiators to reconnect cleanly when we boot again
 	# (i.e. we don't want them to reconnect to a tgtd which is still
 	# working, but the target is gone).
-	tgtadm --op update --mode sys --name State -v offline &>/dev/null
+	tgtadm --op update --mode sys --name State -v offline >/dev/null 2>&1
 	RETVAL=$?
 	if [ "$RETVAL" -eq 107 ] ; then
 	    echo "tgtd is not running"
@@ -96,7 +96,7 @@ reload() {
 	echo "Updating target framework daemon configuration"
 	# Update configuration for targets. Only targets which
 	# are not in use will be updated.
-	tgt-admin --update ALL -c $TGTD_CONFIG &>/dev/null
+	tgt-admin --update ALL -c $TGTD_CONFIG >/dev/null 2>&1
 	RETVAL=$?
 	if [ "$RETVAL" -eq 107 ] ; then
 	    echo "tgtd is not running"
@@ -107,7 +107,7 @@ reload() {
 forcedreload() {
 	echo "Force-updating target framework daemon configuration"
 	# Update configuration for targets, even those in use.
-	tgt-admin --update ALL -f -c $TGTD_CONFIG &>/dev/null
+	tgt-admin --update ALL -f -c $TGTD_CONFIG >/dev/null 2>&1
 	RETVAL=$?
 	if [ "$RETVAL" -eq 107 ] ; then
 	    echo "tgtd is not running"


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-block/tgt/files/
@ 2019-04-11 20:26 Matthew Thode
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Thode @ 2019-04-11 20:26 UTC (permalink / raw
  To: gentoo-commits

commit:     c8a40145ca455cf22abd392f20793a75368fdd80
Author:     Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
AuthorDate: Thu Apr 11 09:53:56 2019 +0000
Commit:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Thu Apr 11 20:26:00 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c8a40145

sys-block/tgt: remove unused patch

Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail.com>
Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org>

 sys-block/tgt/files/tgt-1.0.69-sysmacros.patch | 38 --------------------------
 1 file changed, 38 deletions(-)

diff --git a/sys-block/tgt/files/tgt-1.0.69-sysmacros.patch b/sys-block/tgt/files/tgt-1.0.69-sysmacros.patch
deleted file mode 100644
index 0b28f02e282..00000000000
--- a/sys-block/tgt/files/tgt-1.0.69-sysmacros.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-https://bugs.gentoo.org/580594
-https://github.com/fujita/tgt/pull/25
-
-From b092c6fe330a2eacf4b1d4eb093fad8e2fbcaed9 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sun, 27 Nov 2016 18:47:24 -0500
-Subject: [PATCH] fix build w/newer glibc
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Building with newer glibc versions fails like so:
-bs_sg.c: In function ‘chk_sg_device’:
-bs_sg.c:354:6: error: implicit declaration of function ‘major’ [-Werror=implicit-function-declaration]
-  if (major(st.st_rdev) == SCSI_GENERIC_MAJOR)
-
-This is because glibc is dropping the implicit sys/sysmacros.h include
-from sys/types.h and making the few projects that need it include it
-explicitly.
----
- usr/bs_sg.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/usr/bs_sg.c b/usr/bs_sg.c
-index 66f4a3b22a18..fb544056f258 100644
---- a/usr/bs_sg.c
-+++ b/usr/bs_sg.c
-@@ -32,6 +32,7 @@
- #include <linux/fs.h>
- #include <linux/major.h>
- #include <sys/ioctl.h>
-+#include <sys/sysmacros.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/epoll.h>
--- 
-2.11.0.rc2
-


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-block/tgt/files/
@ 2022-10-07 21:00 Matthew Thode
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Thode @ 2022-10-07 21:00 UTC (permalink / raw
  To: gentoo-commits

commit:     e6d52a99aed57043874f75fcdf21d1381eeb885a
Author:     Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Fri Oct  7 20:26:44 2022 +0000
Commit:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Fri Oct  7 21:00:09 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6d52a99

sys-block/tgt: remove unused patch

Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org>

 sys-block/tgt/files/tgt-1.0.79-fno-common.patch | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/sys-block/tgt/files/tgt-1.0.79-fno-common.patch b/sys-block/tgt/files/tgt-1.0.79-fno-common.patch
deleted file mode 100644
index 08933df021d8..000000000000
--- a/sys-block/tgt/files/tgt-1.0.79-fno-common.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/usr/iscsi/iscsid.c
-+++ b/usr/iscsi/iscsid.c
-@@ -1074,7 +1074,7 @@ void iscsi_rsp_set_residual(struct iscsi_cmd_rsp *rsp, struct scsi_cmd *scmd)
- struct iscsi_sense_data {
- 	uint16_t length;
- 	uint8_t  data[0];
--} __packed;
-+} __attribute__((__packed__));
- 
- static int iscsi_cmd_rsp_build(struct iscsi_task *task)
- {
---- a/usr/iscsi/iser.c
-+++ b/usr/iscsi/iser.c
-@@ -92,7 +92,7 @@ char *iser_portal_addr;
- struct iscsi_sense_data {
- 	uint16_t length;
- 	uint8_t data[0];
--} __packed;
-+} __attribute__((__packed__));
- 
- static size_t buf_pool_sz_mb = DEFAULT_POOL_SIZE_MB;
- static int cq_vector = -1;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-07 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-07 21:00 [gentoo-commits] repo/gentoo:master commit in: sys-block/tgt/files/ Matthew Thode
  -- strict thread matches above, loose matches on Subject: below --
2019-04-11 20:26 Matthew Thode
2016-11-27 23:53 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox