I am a bit confused about -s <servername>.  What is this supposed to do?

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

Reply via email to