iscsi-iname command is very misleading

187 views
Skip to first unread message

Oren

unread,
Nov 8, 2009, 6:42:35 PM11/8/09
to open-iscsi
Hello,

I've encountered too many cases of people thinking the iscsi-iname
command, just like ifconfig, displays the currently configured IQN,
not being aware that, in fact, it generates a new IQN.
The man page (Debian-supplied, not in open-iscsi git) describes it
best, but the --help string is absolutely misleading or even wrong.

Here's my patch, that changes the wording to something similar to the
Debian's man page:
diff --git a/utils/iscsi-iname.c b/utils/iscsi-iname.c
index 7cf0e7a..80fc1d1 100644
--- a/utils/iscsi-iname.c
+++ b/utils/iscsi-iname.c
@@ -62,7 +62,7 @@ main(int argc, char *argv[])
prefix = argv[1];
if (( strcmp(prefix, "-h") == 0 ) ||
( strcmp(prefix, "--help") == 0 )) {
- printf("\nDisplays the iSCSI initiator name
\n");
+ printf("\nGenerates a unique iSCSI node name
on every invocation\n"
exit(0);
} else if ( strcmp(prefix, "-p") == 0 ) {
prefix = argv[2];


Best Regards,

Oren Held
Host-side development
IBM-XIV Storage

Mike Christie

unread,
Nov 9, 2009, 1:43:09 PM11/9/09
to open-...@googlegroups.com

Thanks. Merged in commit 4136ee677385a667de70fdff223c67d4e16842fc.

Ulrich Windl

unread,
Nov 10, 2009, 2:36:48 AM11/10/09
to open-...@googlegroups.com
On 8 Nov 2009 at 15:42, Oren wrote:

>
> Hello,
>
> I've encountered too many cases of people thinking the iscsi-iname

What about naming it "gen-iqn" instead (in the UNIX tradition of having a short
name preferrable over "generate-new-iSCSI-qualified-name-for-initiator")?

Ulrich

Oren Held

unread,
Nov 10, 2009, 6:09:13 AM11/10/09
to open-...@googlegroups.com, Ulrich Windl
I see two independent steps which we can take:

1. RENAME: IMO that get-iqn can still be interpreted as "get current iqn". In
the SSH spirit, I'd choose iscsi-iqn-gen (like ssh-keygen)

Renaming, of course, might break 3rd party scripts who look for iscsi-iname.

2. Print to STDERR "Generating a new IQN...".
This one is not supposed to affect 3rd party scripts, which probably redirect
only the STDOUT.
--

Ulrich Windl

unread,
Nov 11, 2009, 3:05:52 AM11/11/09
to open-...@googlegroups.com
On 10 Nov 2009 at 13:09, Oren Held wrote:

>
> I see two independent steps which we can take:
>
> 1. RENAME: IMO that get-iqn can still be interpreted as "get current iqn". In
> the SSH spirit, I'd choose iscsi-iqn-gen (like ssh-keygen)
>
> Renaming, of course, might break 3rd party scripts who look for iscsi-iname.
>
> 2. Print to STDERR "Generating a new IQN...".
> This one is not supposed to affect 3rd party scripts, which probably redirect
> only the STDOUT.

In the spirit of UNIX, progress messages going to stderr are unusual, except the
process will need significant toime to complete. (MHO)

Ulrich
Reply all
Reply to author
Forward
0 new messages