|
When the Wrapper is launched, it is very careful about making sure that
the working directory is in a known and constant state.
This helps to guarantee that there will be no path related problems caused
by a user launching the Wrapper from an unexpected location.
Windows:
On Windows platforms,
the wrapper.exe sets its own working directory
immediately on startup to the directory where it is located.
This is especially critical on Windows platforms.
When running in a console, the working directory is normally set to
the current directory when an application is launched.
This means that it would be different if the Wrapper was launched as
bin\wrapper.exe versus
.\wrapper.exe versus
..\bin\wrapper.exe.
In addition,
when running as a Windows Service, the working directory is normally set to
the Windows system32 directory.
By always forcing the working directory to the location of the
wrapper.exe,
integrators can reliably make use of relative path references.
Linux/Unix:
Things work a little differently on Linux/Unix platforms.
There, the Wrapper binary does not set its own working directory by default.
This is left up to the script used to launch the Wrapper.
While this has traditionally given more flexibility to Unix users,
the same issues as exist on the Windows platform also exist on Unix.
However, by using the scripts shipped with the Wrapper distribution,
all path issue should be taken good care of.
Flexible Work:
There are times however where having the working directory
set to the location of the Wrapper binary makes it impossible to run some applications cleanly.
An example is an application which expects the working directory to be at the root of the file system.
The only way to run such an application
under the Wrapper would be to place the Wrapper binary and scripts in the root directory.
Not something that most system administrators would want to do.
To allow such cases,
the wrapper.working.dir property was added.
It is very important to understand exactly how this property works to avoid problems.
The wrapper.working.dir property can be specified either in the
wrapper.conf
or as a parameter to the Wrapper binary.
However, the property does not take effect
until AFTER all of the Wrapper's properties have been completely parsed.
This means that the location of the wrapper.conf file
and any include files (cascading style) referenced therein
must still be referenced using locations relative to the Wrapper binary.
This is necessary to make sure that the configuration file can be loaded reliably.
Any and all paths defined in OTHER properties specified
either from the command line
or within the wrapper.conf file
will then be relative to the location specified by the
wrapper.working.dir property.
Confused yet? An example or two is in order.
|