#60 Allow explicitly setting shared library path in config


This patch adds a new option to the config file:

ns_section "ns/parameters"
ns_param sharedlibrary ${nshome}/modules/tcl

This defaults to ns/parameters/home with modules/tcl
appended, which is inconvenient if you want to set the
home directory for a server some where other than your
AOLserver installation.


  • Stephen

    Stephen - 2004-06-15

    Patch to add ns/parameters/sharedlibrary config option

  • Zoran Vasiljevic

    Logged In: YES

    Is this all that is needed? I can hardly believe.

    What about other modules? On Linux, if you have
    /usr/local/aolserver installed, the nsd will always pull
    shared libs
    (libnsd.so for example) from there regardless of the
    LD_LIBRARY_PATH setting. I can't imagine that you can easily
    change the homedir that easily but I'm willing to learn .)

    Now, again, is this all that's needed. IOW, can you give an
    example what do you exactly mean by:
    "set the home directory for a server some where other"

  • Stephen

    Stephen - 2004-06-17

    Logged In: YES

    Sorry, I should have explained more clearly.

    By 'home directory' I mean the setting:

    ns_section "ns/parameters"
    ns_param home /usr/local/aolserver

    AOLserver CDs to this home directory on startup, and that
    seems to be the default location for incomplete file uploads
    to be dumped, which is *really* inconvenient.

    Another issues is one of packaging -- I like to put binaries
    in /usr/bin, log files under /var, websites somewhere else...

    You can of course change ns/parameters/home, but then
    AOLserver can't find the core Tcl modules (init.tcl,
    file.tcl, form.tcl etc.). This patch fixes that.

    I guess another approach would be to look at why file
    uploads end up in the home directory, perhaps force them
    into /tmp. But /tmp is often a different partition, so to
    save needless copying I'd prefer to keep them where the rest
    of the files live.

    The supplied patch seems like a simple, easy way to fix it...


  • Zoran Vasiljevic

    Logged In: YES

    What about:

    nsconf.tcl.sharedlibrary =
    Ns_ConfigGetValue(NS_CONFIG_PARAMETERS, "sharedlibrary");

    if (nsconf.tcl.sharedlibrary == NULL) {
    Ns_HomePath(&ds, "modules", "tcl", NULL);
    nsconf.tcl.sharedlibrary = Ns_DStringExport(&ds);
    } else if (Ns_PathIsAbsolute(nsconf.tcl.sharedlibrary) == NS_FALSE) {
    Ns_HomePath(&ds, nsconf.tcl.sharedlibrary, NULL);
    nsconf.tcl.sharedlibrary = Ns_DStringExport(&ds);

    This way you can even change the layout of the structure
    underneath the home. We should examine wether this
    is the only place things get hard-wired and eventually
    modify all those with constructs as above. This will then
    allow you to make an installation layout of your choice.
    What do you think?


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks