Mailing List Archive

8.1.x -b option fails to bind to port with more than 15 ports?
Hi,

I recently added some more consoles to my .cf file. This pushed the
number of consoles up so that conserver now needs to make two "groups"
(eg: processes that control the consoles).

I am also using the -b option so that conserver starts using ports at a
predefined place so I can punch holes though various firewalls as needed.

When I restarted after adding the extra hosts, conserver never finished
starting. instead is now gives me the following:
ERROR: Spawn(): bind(1301): Address already in use
If I remove the -bNNNN option from the command line and restart, it works
quite happily. If I remove the consoles I just added and restart *with*
the -b option, it also works happily.

I though this might be a problem with conserver-8.1.1, so I rebuilt with
8.1.3 (and after changing my device and devicesubst lines :) it still
happens.

So, uhh.. is this a buglet? If so is there a workaround or am I just doing
something dumb?

Platform is i386 / Red Hat Enterprise Linux 3 WS. Machine is a Compaq
DL350 using Cyclades Ze 32 port serial expanders.

Please help! I'm *supposed* to be on vacation starting tomorrow morning
and I'd really like to be!

Here's the log from startup (I;ve substituted "1" for all my console names
for obvious reasons :):
----SNIP
[Tue Apr 6 17:24:26 2004] conserver (11070): conserver.com version 8.1.3
[Tue Apr 6 17:24:26 2004] conserver (11070): started as `root' by `root'
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC24
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC23
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC22
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC21
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC20
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC19
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC18
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC17
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC16
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC15
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC14
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC13
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC12
[Tue Apr 6 17:24:26 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC11
[Tue Apr 6 17:24:27 2004] conserver (11071): INFO: [1] at 9600n on /dev/ttyC10
[Tue Apr 6 17:24:27 2004] conserver (11070): INFO: group #0 pid 11071 on port 1301
[Tue Apr 6 17:24:27 2004] conserver (11070): ERROR: Spawn(): bind(1301):Address already in use
[Tue Apr 6 17:24:27 2004] conserver (11071): INFO: [1] at9600n on /dev/ttyC0
----END

Thanks!

-n
--
-------------------------------------------
nathan hruby <nhruby@uga.edu>
uga enterprise information technology services
production systems support
metaphysically wrinkle-free
-------------------------------------------
Re: 8.1.x -b option fails to bind to port with more than 15 ports? [ In reply to ]
On Tue, Apr 06, 2004 at 05:39:44PM -0400, nathan r. hruby wrote:
> So, uhh.. is this a buglet? If so is there a workaround or am I just
> doing something dumb?

thanks for providing all the info, and, yep, you've got yourself a
buglet. congrats! ;-)

luckily, it's an easy fix. and sorry it was hangin' around all this
time...guess not many folks use -b in the 8.x.x world (with a bunch of
consoles).

for conserver-8.1.3 go to line 4512 of conserver/group.c:

4510 (errno == EADDRINUSE) ||
4511 #endif
4512 (errno == EACCES)) && portInc++) {
4513 lstn_port.sin_port = htons(bindBasePort + portInc);
4514 } else {

and change that "portInc++" to a "++portInc". the same can be applied
to conserver-8.1.1 on line 4406 (but if you've got 8.1.3 going, i'd
certainly stick with it).

hmmm...the 7.2.7 code appears to be the same. i haven't tried it, but
it probably doesn't work either (doesn't look like it should). anyone
out there trying to use that can apply the same fix to line 3316.

> Please help! I'm *supposed* to be on vacation starting tomorrow
> morning and I'd really like to be!

hopefully this makes everything well and you can have a great vacation.

Bryan
Re: 8.1.x -b option fails to bind to port with more than 15 ports? [ In reply to ]
Thanks trying it now :)

Will report back...

-n


On Tue, 6 Apr 2004, Bryan Stansell wrote:

> On Tue, Apr 06, 2004 at 05:39:44PM -0400, nathan r. hruby wrote:
> > So, uhh.. is this a buglet? If so is there a workaround or am I just
> > doing something dumb?
>
> thanks for providing all the info, and, yep, you've got yourself a
> buglet. congrats! ;-)
>
> luckily, it's an easy fix. and sorry it was hangin' around all this
> time...guess not many folks use -b in the 8.x.x world (with a bunch of
> consoles).
>
> for conserver-8.1.3 go to line 4512 of conserver/group.c:
>
> 4510 (errno == EADDRINUSE) ||
> 4511 #endif
> 4512 (errno == EACCES)) && portInc++) {
> 4513 lstn_port.sin_port = htons(bindBasePort + portInc);
> 4514 } else {
>
> and change that "portInc++" to a "++portInc". the same can be applied
> to conserver-8.1.1 on line 4406 (but if you've got 8.1.3 going, i'd
> certainly stick with it).
>
> hmmm...the 7.2.7 code appears to be the same. i haven't tried it, but
> it probably doesn't work either (doesn't look like it should). anyone
> out there trying to use that can apply the same fix to line 3316.
>
> > Please help! I'm *supposed* to be on vacation starting tomorrow
> > morning and I'd really like to be!
>
> hopefully this makes everything well and you can have a great vacation.
>
> Bryan
> _______________________________________________
> users mailing list
> users@conserver.com
> https://www.conserver.com/mailman/listinfo/users
>

--
-------------------------------------------
nathan hruby <nhruby@uga.edu>
uga enterprise information technology services
production systems support
metaphysically wrinkle-free
-------------------------------------------
Re: 8.1.x -b option fails to bind to port with more than 15 ports? [ In reply to ]
On Tue, 6 Apr 2004, nathan r. hruby wrote:

>
> Thanks trying it now :)
>
> Will report back...
>

Works awesomely! Thanks much! If You're in New Orleans this weekend or
in the Atlanta metro area ever, I owe you dinner! Thanks so much!

For those building RPM's here's a patch that you can drop in easily:

----BEGIN
--- conserver/group-pre_base_fix.c 2004-04-06 20:00:15.000000000-0400
+++ conserver/group.c 2004-04-06 20:00:34.000000000 -0400
@@ -4509,7 +4509,7 @@
#if defined(EADDRINUSE)
(errno == EADDRINUSE) ||
#endif
- (errno == EACCES)) && portInc++) {
+ (errno == EACCES)) && ++portInc) {
lstn_port.sin_port = htons(bindBasePort + portInc);
} else {
Error("Spawn(): bind(%hu): %s", ntohs(lstn_port.sin_port),
----END

I also have a few other odd things and some rpm specfile patches to submit
back up, they just need some cleaning. I'll try to get those posted next
week :)

> -n
>
>
> On Tue, 6 Apr 2004, Bryan Stansell wrote:
>
> > On Tue, Apr 06, 2004 at 05:39:44PM -0400, nathan r. hruby wrote:
> > > So, uhh.. is this a buglet? If so is there a workaround or am I just
> > > doing something dumb?
> >
> > thanks for providing all the info, and, yep, you've got yourself a
> > buglet. congrats! ;-)
> >
> > luckily, it's an easy fix. and sorry it was hangin' around all this
> > time...guess not many folks use -b in the 8.x.x world (with a bunch of
> > consoles).
> >
> > for conserver-8.1.3 go to line 4512 of conserver/group.c:
> >
> > 4510 (errno == EADDRINUSE) ||
> > 4511 #endif
> > 4512 (errno == EACCES)) && portInc++) {
> > 4513 lstn_port.sin_port = htons(bindBasePort + portInc);
> > 4514 } else {
> >
> > and change that "portInc++" to a "++portInc". the same can be applied
> > to conserver-8.1.1 on line 4406 (but if you've got 8.1.3 going, i'd
> > certainly stick with it).
> >
> > hmmm...the 7.2.7 code appears to be the same. i haven't tried it, but
> > it probably doesn't work either (doesn't look like it should). anyone
> > out there trying to use that can apply the same fix to line 3316.
> >
> > > Please help! I'm *supposed* to be on vacation starting tomorrow
> > > morning and I'd really like to be!
> >
> > hopefully this makes everything well and you can have a great vacation.
> >
> > Bryan
> > _______________________________________________
> > users mailing list
> > users@conserver.com
> > https://www.conserver.com/mailman/listinfo/users
> >
>
>

--
-------------------------------------------
nathan hruby <nhruby@uga.edu>
uga enterprise information technology services
production systems support
metaphysically wrinkle-free
-------------------------------------------