Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 181122 Details for
Bug 228729
[science] sys-block/tgt - Linux SCSI target framework (tgt) new ebuild
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
tgtd
tgtd (text/plain), 3.25 KB, created by
r01
on 2009-02-06 08:35:25 UTC
(
hide
)
Description:
tgtd
Filename:
MIME Type:
Creator:
r01
Created:
2009-02-06 08:35:25 UTC
Size:
3.25 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2008 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Header: $ > >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 > # 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 -e -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" > [ "$TASK" != "restart" ] && exit 1 > 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" > [ "$TASK" != "restart" ] && exit 1 > 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 >}
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 Raw
Actions:
View
Attachments on
bug 228729
:
157905
|
157907
|
181121
| 181122