We're using the -s option effectively, although it required a small
modification to the server. If you take the following line from nsmain.c:

nsconf.server = nsServer = server;

And copy it above the section that loads the config file, then ns_info
server will be available during config, and you can do any switching
necessary.

This allows us to have a single config file that manages all of our
environments. Makes life a lot easier.

Sean



-----Original Message-----
From: Jeff Nichols
Sent: Thursday, September 27, 2001 5:58 PM
To: Sean Owen
Subject: FW: [AOLSERVER] The -s command line option

these guys could use your patch...

-----Original Message-----
From: Jim Wilcoxson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 27, 2001 4:27 PM
To: [EMAIL PROTECTED]
Subject: Re: [AOLSERVER] The -s command line option


As a suggestion, a -e option with TCL that is eval'd before running nsd.tcl
would be useful.  We have 8 servers that are mostly configured the same
except for a handful of parameters, specifically:

- the listening port
- does it need to load nsperms?
- keepalive is not enabled for some
- log files are different

Guess I will make 8 small shell scripts, set an environment variable
differently in each one, use $env(blah) to do the conditional stuff...

Thanks!
Jim

>
> At 04:01 PM 9/27/01, you wrote:
> >I am a bit confused about -s <servername>.  What is this supposed to do?
>
> Sadly, and empirically, I have determined that that since AOLserver 3.3,
> that option has retroactively been written to annoy you.  It was a
> meaningful option in AOLserver's 3.0, 3.1, and 3.2 and many folks wrote
> code that does just what you see to do, but this code broke in AOLserver
3.3.
>
> Bug reports and patches were supplied at sourceforge (by users), but the
> AOLserver support team determined that uniform support for this feature
> within the AOLserver 3.x series was not a good idea.
>
> Several users have asked AOLserver for support for this feature in the
> AOLserver 4 series, and AOLserver has been quiet about their intentions
> thus far.
>
> Regrets,
>
>
> Jerry
>
>
> >If I use multiple -s options, the code at nsmain.c/212 catches that
error.
> >
> >But if I don't use any -s option and completely remove the ns/servers
> >section, things still work.  I expected an error because of the code at
> >nsmain.c/475:
> >
> >     /*
> >      * Determine the server to run.
> >      */
> >
> >     if (server != NULL) {
> >         if (Ns_ConfigGet(NS_CONFIG_SERVERS, server) == NULL) {
> >             Ns_Fatal("nsmain: no such server '%s'", server);
> >         }
> >     } else {
> >         Ns_Set *set;
> >
> >         set = Ns_ConfigGetSection(NS_CONFIG_SERVERS);
> >         if (set == NULL || Ns_SetSize(set) != 1) {
> >             Ns_Fatal("nsmain: no server specified: "
> >                      "specify '-s' parameter or specify "
> >                      NS_CONFIG_SERVERS " in config file");
> >         }
> >         server = Ns_SetKey(set, 0);
> >     }
> >     nsconf.server = nsServer = server;
> >
> >What I want is to be able to pass an argument to allow conditional
> >execution of the nsd.tcl file, but I don't want to duplicate every
> >ns/server/<server>/xxx section of the file to do that.
> >
> >Use an environment variable and execute nsd from a shell script??
> >
> >I know there was a discussion about the -s option a while back, but
> >I looked through all my email/SF and couldn't find it.
> >
> >Thanks for any guidance,
> >Jim
>
> ========================================================
> Jerry Asher                      [EMAIL PROTECTED]
> 1678 Shattuck Avenue Suite 161   Tel: (510) 549-2980
> Berkeley, CA 94709               Fax: (877) 311-8688
>

Reply via email to