icebox environment variables

rpetersrpeters Member Rich PetersOrganization: braxton technologyProject: cross platfrom JNI replacement ✭✭
Hi,

I was trying to set the path for my icebox server in the icebox environment variables. the following fails: its there a way to add directories to the path?
<icebox id="AlsIceBox" activation="on-demand" exe="iceboxd" pwd="C:\Dev\CORE4\Services\ALS">
<description>The ALS IceBox server</description>
<env>PATH=%QtDir%\Bin;C:\Dev\CORE4\Common\Lib;%PATH%</env>
<properties>
<property name="IceBox.InstanceName" value="${server}"/>
<property name="IceBox.Trace.ServiceObserver" value="1"/>
</properties>
<service-instance template="AlsService" name="Als"/>
</icebox>

thanks
Rich

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Rich,

    This is expected to work, and we even provide a similar example in the manual:
    http://www.zeroc.com/doc/Ice-3.4.1/manual/IceGrid.39.17.html

    Could you describe what does not work?

    Are you running the IceGride node as a Windows service? In that case, remember that its environment (%PATH% etc) may not match your own environment.

    Best regards,
    Bernard
  • rpetersrpeters Member Rich PetersOrganization: braxton technologyProject: cross platfrom JNI replacement ✭✭
    Bernard,

    I see the following syntax in your article:

    PATH=/opt/Ice/bin:$PATH

    Is $PATH linux shell script or ICE? (I am obviously no linux guru)

    on windows, I have:
    PATH=%QtDir%\Bin;C:\Dev\CORE4\Common\Lib;%PATH%

    where environment variables are surrounded with %%.

    This is not as a service. If I use any syntax, it seems to clobber the entire path, which is expected if it doesnt handle the %PATH%

    Net effect is my icebox service cant load.

    thanks
    Rich
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Rich,

    Yes, $PATH is for Linux. For Windows, it's fine to use the %ENVVAR% syntax (as described in the example here).

    Could the failure to load the service be caused by another issue? What is the error? Did you try enabling tracing to see the settings used by the IceGrid node to start the server (including environment variables)? You can enable this tracing by adding IceGrid.Node.Trace.Activator=2 in your IceGrid node configuration file.

    Also, which Ice version do you use?

    Cheers,
    Benoit.
  • rpetersrpeters Member Rich PetersOrganization: braxton technologyProject: cross platfrom JNI replacement ✭✭
    The tracing didnt really add any usefull output

    I upped the property:
    IceGrid.Node.Trace.Activator=2

    I see:
    !! 06/29/10 14:41:00.455 OssIceBox: error: ServiceManager: unable to load entry point `C:\Dev\CORE4\Services\lib\Oss:create'

    in the icebox log file. It didnt really add any information.
    I am running Ice 3.4.1 on windows 7 x64.

    If I place anything in the path env var in the xml file, It seems to truncate off the system path, and I get a qtcored4.dll not found. Also, for some reason a dll that the icebox service depends on , and is in the same directory as the icebox service dll does not get found.
    If I add these directories to the system path prior to launching, all is fine.
    But I need the local path redirect

    thanks
    Rich
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi

    Could you copy/paste the output of the node tracing? The tracing should show the setting of the PATH environment for the IceBox process when the node activates it. Is the PATH setting truncated in the trace?

    Cheers,
    Benoit.
  • rpetersrpeters Member Rich PetersOrganization: braxton technologyProject: cross platfrom JNI replacement ✭✭
    Apparently the tracing is not having any effect. perhaps I have it in the wrong place? Does it belong inside the icebox configuration?

    here is the section of the icegrid config file:
    #
    # IceGrid node configuration.
    #
    IceGrid.Node.Name=localhost
    IceGrid.Node.Endpoints=default
    IceGrid.Node.Data=config/db/node
    IceGrid.Node.CollocateRegistry=1
    IceGrid.Node.Output=config/db
    IceGrid.Node.RedirectErrToOut=1

    Ice.StdErr=config\icegrid.log

    #
    # Trace properties.
    #
    IceGrid.Node.Trace.Activator=2
    IceGrid.Node.Trace.Adapter=2
    IceGrid.Node.Trace.Server=3

    here is the trace from the icegrid log file:
    -- 06/30/10 08:09:02.457 icegridnode.exe: Server: changed server `OssIceBox' state to `Activating'
    -- 06/30/10 08:09:02.457 icegridnode.exe: Activator: activating server `OssIceBox'
    path = C:\Program Files (x86)\ZeroC\Ice-3.4.1\bin\iceboxd.exe
    pwd = C:\Dev\CORE4\Services\OSS
    envs =
    args = C:\Program Files (x86)\ZeroC\Ice-3.4.1\bin\iceboxd.exe --Ice.Config=c:\\Dev\\CORE4\\Services\\OSS/config/db/node/servers/OssIceBox/config/config
    -- 06/30/10 08:09:02.462 icegridnode.exe: Server: changed server `OssIceBox' state to `WaitForActivation'
    -- 06/30/10 08:10:02.457 icegridnode.exe: Server: changed server `OssIceBox' state to `ActivationTimeout'
    -- 06/30/10 08:10:02.457 icegridnode.exe: Server: server `OssIceBox' activation timed out
    -- 06/30/10 08:10:02.457 icegridnode.exe: Adapter: server `OssIceBox' adapter `OssIceBox.Oss.OssService-$(name)' activation failed: server activation timed out
    -- 06/30/10 08:10:34.406 icegridnode.exe: Server: changed server `OssIceBox' state to `Active'
    -- 06/30/10 08:10:34.406 icegridnode.exe: Adapter: server `OssIceBox' adapter `OssIceBox.Oss.OssService-$(name)' activation failed: server activation completed


    Is the unexpanded $(name) above an issue?

    thanks
    Rich
  • rpetersrpeters Member Rich PetersOrganization: braxton technologyProject: cross platfrom JNI replacement ✭✭
    %PATH% is being omitted

    Benoit,

    here is the trace finally:
    -- 06/30/10 11:31:42.450 icegridnode.exe: Activator: activating server `OssIceBox'
       path = C:\Program Files (x86)\ZeroC\Ice-3.4.1\bin\iceboxd.exe
       pwd = C:\Dev\CORE4\Services\OSS
       envs = PATH=C:\Dev\CORE4\Common\Lib;
       args = C:\Program Files (x86)\ZeroC\Ice-3.4.1\bin\iceboxd.exe  --Ice.Config=c:\\Dev\\CORE4\\Services\\OSS/config/db/node/servers/OssIceBox/config/config
    

    That is for an xml that has:
    <env>PATH=C:\Dev\CORE4\Common\Lib;%PATH%</env>
    

    thanks
    Rich
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Rich,

    I was able to reproduce this problem by modifying the IceGrid/icebox demo on Windows. This looks like a bug. We'll investigate!

    Thanks,
    Bernard
  • rpetersrpeters Member Rich PetersOrganization: braxton technologyProject: cross platfrom JNI replacement ✭✭
    Bernard,

    thanks for verifying this

    Rich
  • rpetersrpeters Member Rich PetersOrganization: braxton technologyProject: cross platfrom JNI replacement ✭✭
    Bernard,

    while I was debugging this, I found some rather odd paths inside the generated icebox config file on the IceBox.Service property:
    # Configuration file (06/30/10 14:22:57.212)
    
    # Server configuration
    Ice.Admin.ServerId=AlsIceBox
    Ice.Admin.Endpoints=tcp -h 127.0.0.1
    Ice.ProgramName=AlsIceBox
    IceBox.Service.Als=C:\\Dev\\CORE4\\Services\\lib\\Als:create --Ice.Config\='c:\\\\Dev\\\\CORE4\\\\Services\\\\OSS/config/db/node/servers/AlsIceBox/config/config_Als'
    IceBox.LoadOrder=Als\ 
    # Server descriptor properties
    IceBox.InstanceName=AlsIceBox
    IceBox.Trace.ServiceObserver=1
    Ice.StdErr=config/db/AlsIceBox.out
    Ice.StdOut=config/db/AlsIceBox.out
    Ice.Default.Locator=SystemIceGrid/Locator:default -p 4061
    

    that is a lot of backslashes

    thanks
    Rich
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Rich,

    The double-backslash is expected, because \ is the escape character in Ice configuration files; see http://www.zeroc.com/doc/Ice-3.4.1/manual/Properties.31.3.html.

    So C:\Dev is "encoded" as C:\\Dev. However, these quadruple backslashes look indeed suspicious!

    Thanks,
    Bernard
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Rich,

    I've just posted a patch for this environment variable expansion bug: http://www.zeroc.com/forums/patches/4999-patch-1-ice-3-4-1-icegrid-var-handling-windows-only.html

    It was a typo in an update for Ice 3.4.0 that we didn't not catch earlier, unfortunately.

    Thanks for the bug report!
    Bernard
Sign In or Register to comment.