Menu ▾ ▴

#168 environment for windows Service

v3.2.3
open-fixed
Service (34)
5
2007-04-21
2007-04-17
No

There is a problem with PATH variable for service run under the user
accont. Running 'set PATH' from cmd shows value for PATH being concatinated
from both system environment value and user's one. But JavaServiceWrapper
get's the path only from user's environment.

Discussion

  • Eugene Petrenko

    Eugene Petrenko - 2007-04-19

    Logged In: YES
    user_id=1724972
    Originator: YES

    Problem with recursive definitions in PATH variable:
    PATH=%PATH%;c:\foo\bar

    As the result there is no PATH variable at all

     
  • Eugene Petrenko

    Eugene Petrenko - 2007-04-19
    • labels: --> Service
    • milestone: --> v3.2.3
    • priority: 5 --> 9
     
  • Leif Mortenson

    Leif Mortenson - 2007-04-21

    Logged In: YES
    user_id=228081
    Originator: NO

    When run as a service, the Wrapper manually loads the environment from the system registry. If this was not done, it would be necessary to reboot the system before any environment changes would become visible to the service. Most applications require this, but I was trying to go one step further.

    The Wrapper works by always loading in the SYSTEM environment, then if a specific account is specified, it will load that variable in over the SYSTEM values. This is correct for everything except the PATH. You are correct that the PATH needs to be appended.

    I reworked that code a bit so it also more efficient memory wise. The PATH variable is now special cased so if a PATH is set both in the user and SYSTEM accounts, the user account value will be appended to that of the SYSTEM account.

    This will be in the 3.3.0 release.

    I also tested out appending to the PATH variable. This is a feature that I make use of in several applications. Did you try this format:

    set.PATH=%PATH%;C:\foo\bar

    Thanks for pointing this out.
    Cheers,
    Leif

     
  • Leif Mortenson

    Leif Mortenson - 2007-04-21
    • priority: 9 --> 5
    • assigned_to: nobody --> mortenson
    • status: open --> open-fixed
     

Log in to post a comment.