README.NetConsole question
Hello List!
I'm trying to use netconsole on my board but I met unxecpected problems on host side (the machine I'm trying to connect to u-boot'ed board).
I'm trying to use on the host side script from README.NetConsole. The one which is quoted below. When I start the script, my Linux complains about the string "nc -u -l -p 6666".
As the "man nc" states about -l option, "It
is an error to use this option in conjunction with the -p".
Regarding -p: "It is an error to use this option in conjunction with the -l option."
Am I doing something wrong? Should I change nc utility or script?
U-boot version is 1.1.6, host machine uses
Fedora Core 5, nc (netcat utility) is from "nc-1.84-3.2.rpm".
The script from README.NetConsole:
#!/bin/bash -x
[ $# = 1 ] || { echo "Usage: $0 target_ip" >&2 ; exit 1 ; } TARGET_IP=$1
stty -icanon -echo intr ^T
nc -u -l -p 6666 < /dev/null &
nc -u ${TARGET_IP} 6666
stty icanon echo intr ^C
Best regards,
Igor Marnat
mailto:[email protected]
Hi Igor,
Quoted 10 lines
I'm trying to use netconsole on my board but I met unxecpected problems on host side (the machine I'm trying to connect to u-boot'ed board).
I'm trying to use on the host side script from README.NetConsole. The one which is quoted below. When I start the script, my Linux complains about the string "nc -u -l -p 6666".
As the "man nc" states about -l option, "It
is an error to use this option in conjunction with the -p".
Huh! Where exactly does it say so? I cannot even find "error" in the manpage to my nc (1.10-32 on a Debian system). Actually this statement is nonsense, -l tells netcat to "l"isten on a socket and -p tells it the portnumber. How exactly should one start netcat as a listener without combining these options?
Please check the netcat that you have - maybe "nc" simply isn't netcat on your system. Sometimes the binary is called "netcat".
Cheers
Detlev
Signature · 4 lines
He thinks he's really smooth, but he's only C^1. -- DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk Office: Kirchenstr. 5, D-82194 Groebenzell, Germany +49 8142 66989 40
Hi Igor & Detlev,
Quoted 5 lines
Quoted 2 lines
As the "man nc" states about -l option, "It
is an error to use this option in conjunction with the -p".Huh! Where exactly does it say so? I cannot even find "error" in the manpage to my nc (1.10-32 on a Debian system).
On my FC5 system, (nc-1.84-3.2) the netcat manpage does make such a statement:
Quoted 5 lines
-l Used to specify that nc should listen for an incoming connection
rather than initiate a connection to a remote host. It is an error to use this option in conjunction with the -p, -s, or -z options. Additionally, any timeouts specified with the -w option are ignored.
Note that it does not define an option parameter in the manpage documentation for the option ... but the "CLIENT/SERVER MODEL" section of the manpage gives an example:
Quoted 5 lines
It is quite simple to build a very basic client/server model using nc. On one console, start nc listening on a specific port for a connection. For example:
$ nc -l 1234
I'm not sure when or why the option differences started between your two versions of netcat -- but they do apparently exist.
That said, you may want to use the following if your version complains about the -l and -p options being used together:
$ nc -u -l 6666
Regards,
--Scott
Hi,
Quoted 5 lines
Quoted 2 lines
Huh! Where exactly does it say so? I cannot even find "error" in the manpage to my nc (1.10-32 on a Debian system).
On my FC5 system, (nc-1.84-3.2) the netcat manpage does make such a statement:
Wow, a short research shows that netcat is not a program but a whole family :) Just for the records the Debian netcat seems to be the original implementation by <hobbit AT atstake DOT com>.
Anyway, if the netcat from FedoraCore wins out and -l does not combine with -p anymore, can someone please fix Wikipedia[1]?
Thanks
Detlev
[1] http://en.wikipedia.org/wiki/Netcat
Signature · 6 lines
Directories are added, deleted, and rearranged much as you would
expect, even if you don't know it's what you'd expect.
-- Tom Lord in TLA Documentation
--
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office: Kirchenstr. 5, D-82194 Groebenzell, Germany +49 8142 66989 40Quoted 3 lines
Wow, a short research shows that netcat is not a program but a whole family :) Just for the records the Debian netcat seems to be the original implementation by <hobbit AT atstake DOT com>.
I checked the CVS repo at OpenBSD It looks like the -l -p option interaction was pulled in when Eric Jackson's updates for IPv6 support were added in Revision 1.21
http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/netcat.c
The commit comments seem humorous (but only in hindsight):
"Import completely re-written netcat w/ support for IPv6. very little usage has changed ...."
Quoted 2 lines
Anyway, if the netcat from FedoraCore wins out and -l does not combine with -p anymore, can someone please fix Wikipedia[1]?
That and a hundred other web pages! ;-)
Best Regards,
--Scott
PATCH 1/1 README.NetConsole
Hello folks,
Quoted 2 lines
Quoted 2 lines
Anyway, if the netcat from FedoraCore wins out and -l does not combine with -p anymore, can someone please fix Wikipedia[1]?
SM> That and a hundred other web pages! ;-)
Thank you to all guys for the help.
I'd suggest the following patch to begin with. May be native english guys correct me.
doc/README.NetConsole 2007-03-16 08:04:31.000000000 +0300 renamed from doc/README.NetConsole 2006-11-02 17:15:01.000000000 +0300 +5 -0
@@ -34,6 +34,11 @@ stty icanon echo intr ^C +++++++++++++++++++++++++++++++++++++++++++ +Be aware that in some distributives (Fedora Core 5 at least) usage of +nc has been changed and -l and -p options are considered as mutually exclusive. +If nc complains about options provided, try to rebuild it from scratch. +Known working version lives in nc110.tgz + The script expects exactly one argument, which is interpreted as the target IP address (or host name, assuming DNS is working). The script can be interrupted by pressing ^T (CTRL-T).
Best regards,
Igor Marnat
mailto:marny at rambler.ru
PATCH 1/1 README.NetConsole
Hi Igor
doc/README.NetConsole 2007-03-16 08:04:31.000000000 +0300 line 40
Quoted 4 lines
doc/README.NetConsole 2007-03-16 08:04:31.000000000 +0300 renamed from doc/README.NetConsole 2006-11-02 17:15:01.000000000 +0300 +4
-0+Be aware that in some distributives (Fedora Core 5 at least) usage of +nc has been changed and -l and -p options are considered as mutually exclusive. +If nc complains about options provided, try to rebuild it from scratch. +Known working version lives in nc110.tgz
You may want suggest simply removing the "-p" from the script. That way you won't have to rebuild anything. E.g.:
Be aware that in some distributives (Fedora Core 5 at least) usage of nc has been changed and -l and -p options are considered as mutually exclusive. If nc complains about options provided, you can remove the -p option from the script. For example:
+++++++++++++++++++++++++++++++++++++++++++
#! /bin/bash
[ $# = 1 ] || { echo "Usage: $0 target_ip" >&2 ; exit 1 ; } TARGET_IP=$1
stty -icanon -echo intr ^T
nc -u -l 6666 < /dev/null &
nc -u ${TARGET_IP} 6666
stty icanon echo intr ^C
+++++++++++++++++++++++++++++++++++++++++++
Regards,
--Scott
PATCH 1/1 README.NetConsole
Quoted 8 lines · In message <[email protected]> you wrote:
doc/README.NetConsole 2007-03-16 08:04:31.000000000 +0300 line 40
Quoted 5 lines
doc/README.NetConsole 2007-03-16 08:04:31.000000000 +0300 renamed from doc/README.NetConsole 2006-11-02 17:15:01.000000000 +0300 +4
-0+Be aware that in some distributives (Fedora Core 5 at least) usage of +nc has been changed and -l and -p options are considered as mutually exclusive. +If nc complains about options provided, try to rebuild it from scratch. +Known working version lives in nc110.tgzYou may want suggest simply removing the "-p" from the script. That way you won't have to rebuild anything. E.g.:
...
Now if you could please submit this as a patch against README.NetConsole ?
Thanks in advance.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk Office: Kirchenstr. 5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Backed up the system lately?
PATCH 1/1 README.NetConsole
Hello guys,
WD> Now if you could please submit this as a patch against WD> README.NetConsole ?
Here it goes. I tried, it works.
doc/README.NetConsole 2007-03-19 09:20:51.000000000 +0300 renamed from doc/README.NetConsole 2006-11-02 17:15:01.000000000 +0300 +17 -0
@@ -34,6 +34,23 @@ stty icanon echo intr ^C +++++++++++++++++++++++++++++++++++++++++++ +Be aware that in some distributives (Fedora Core 5 at least) +usage of nc has been changed and -l and -p options are considered +as mutually exclusive. If nc complains about options provided, +you can remove the -p option from the script. For example: + ++++++++++++++++++++++++++++++++++++++++++++ +#! /bin/bash + +[ $# = 1 ] || { echo "Usage: $0 target_ip" >&2 ; exit 1 ; } +TARGET_IP=$1 + +stty -icanon -echo intr ^T +nc -u -l 6666 < /dev/null & +nc -u ${TARGET_IP} 6666 +stty icanon echo intr ^C ++++++++++++++++++++++++++++++++++++++++++++ + The script expects exactly one argument, which is interpreted as the target IP address (or host name, assuming DNS is working). The script can be interrupted by pressing ^T (CTRL-T).
Best regards,
Igor Marnat
mailto:[email protected]
PATCH 1/1 README.NetConsole
Igor,
On Mon, 2007-03-19 at 09:24 +0300, Igor Marnat wrote:
<snip>
Quoted 7 lines
doc/README.NetConsole 2007-03-19 09:20:51.000000000 +0300 renamed from doc/README.NetConsole 2006-11-02 17:15:01.000000000 +0300 +7
-0+Be aware that in some distributives (Fedora Core 5 at least) +usage of nc has been changed and -l and -p options are considered +as mutually exclusive. If nc complains about options provided, +you can remove the -p option from the script. For example: + ++++++++++++++++++++++++++++++++++++++++++++ +#! /bin/bash
doc/README.NetConsole 2007-03-19 09:20:51.000000000 +0300 line 53
Quoted 10 lines
doc/README.NetConsole 2007-03-19 09:20:51.000000000 +0300 renamed from doc/README.NetConsole 2006-11-02 17:15:01.000000000 +0300 +10
-0+ +[ $# = 1 ] || { echo "Usage: $0 target_ip" >&2 ; exit 1 ; } +TARGET_IP=$1 + +stty -icanon -echo intr ^T +nc -u -l 6666 < /dev/null & +nc -u ${TARGET_IP} 6666 +stty icanon echo intr ^C ++++++++++++++++++++++++++++++++++++++++++++ +
I don't think it's necessary to repeat the script in its entirety, since the difference is only two characters. The descriptive paragraph should be enough.
Also, please submit with a 'Signed-off-by' line so it gets properly tracked.
regards,
Ben
PATCH 1/1 README.NetConsole
Hello Ben,
BW> I don't think it's necessary to repeat the script in its entirety, since BW> the difference is only two characters. The descriptive paragraph should BW> be enough.
Yes, I think you are right.
BW> Also, please submit with a 'Signed-off-by' line so it gets properly BW> tracked.
I'm not an advanced user of git unfortunately. Anyway, I did my best, hope it's ok now.
--- doc/README.NetConsole | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
doc/README.NetConsole +5 -0
@@ -38,6 +38,11 @@ The script expects exactly one argument, which is interpreted as the target IP address (or host name, assuming DNS is working). The script can be interrupted by pressing ^T (CTRL-T). +Be aware that in some distributives (Fedora Core 5 at least) +usage of nc has been changed and -l and -p options are considered +as mutually exclusive. If nc complains about options provided, +you can just remove the -p option from the script. + It turns out that 'netcat' cannot be used to listen to broadcast packets. We developed our own tool 'ncb' (see tools directory) that listens to broadcast packets on a given port and dumps them to the
Signature · 6 lines
1.4.4.2 Best regards, Igor Marnat mailto:marny at rambler.ru
Hello Detlev,
DZ> Please check the netcat that you have - maybe "nc" simply isn't netcat DZ> on your system. Sometimes the binary is called "netcat".
Thank you for your reply, it really helped.
I rebuilt nc from sources (nc110.tgz) and data from the board really appears on my host side as if it was serial console. Obviously distributive of Fedora Core 5 contains some strange version of nc.
Perhaps it worth to mentioned in README.NetConsole.
Best regards,
Igor Marnat
mailto:marny at rambler.ru