[stgt] [RFC] example init.d script for tgtd

Tomasz Chmielewski mangoo at wpkg.org
Tue Oct 21 13:49:34 CEST 2008


FUJITA Tomonori schrieb:
> On Tue, 21 Oct 2008 13:27:04 +0200
> Tomasz Chmielewski <mangoo at wpkg.org> wrote:
> 
>> ronnie sahlberg schrieb:
>>
>> (...)
>>
>>>> the RHEL script will probably fail to start here (may depend on machine,
>>>> load etc.):
>>>>
>>>>        daemon tgtd $TGTD_OPTIONS
>>>>
>>>>        # read the config        tgt-admin -e -c "${TGTD_CONFIG}"
>>>>
>>>>
>>>> tgtd starts in the background immediately, but does not yet accept commands
>>>> from tgtadm. So adding "sleep 1" between starting tgtd and tgt-admin should
>>>> help.
>>>>
>>> Having to explicitely add a sleep in scripts is a bit dodgy.
>>>
>>> Maybe better to enhance tgtadm to try-and-retry for x seconds before
>>> giving up and thus hiding this
>>> ugly race from the average user?
>> Or tgtd shouldn't background when it's not ready to accept commands yet.
> 
> I guess that 'daemon' program forks tgtd. Then tgtd can't do anything.

Umm, it seems to me that it's tgtd itself:

# tgtd ; tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2008-01.....
tgtadm: can't connect to the tgt daemon, Connection refused
tgtadm: can't send the request to the tgt daemon, Transport endpoint is not connected

Lets wait a second, and try again - it succeeds:

# tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2008-01....
# 


-- 
Tomasz Chmielewski
http://wpkg.org
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list