... | ... | @@ -70,4 +70,24 @@ The *start* tag is mandatory, the associated executable program is executed when |
|
|
|
|
|
When the *stop* tag is defined, a *stop* command is executed corresponding to the executable with the arguments *args*. It can be useful for programs that can be stopped nicely with a signal. However for managed Cameo apps, it is better to define a stop handler that is automatically triggered when a *stop* is requested.
|
|
|
|
|
|
When the *error* tag is defined, an *error* command is executed when the application finishes with an error. That can be a segmentation fault for a C++ program or an exception for a Java program. In that case, the error can be processed e.g. analyze the generated core to send an email. |
|
|
\ No newline at end of file |
|
|
When the *error* tag is defined, an *error* command is executed when the application finishes with an error. That can be a segmentation fault for a C++ program or an exception for a Java program. In that case, the error can be processed e.g. analyze the generated core to send an email.
|
|
|
|
|
|
# Environment files
|
|
|
|
|
|
An application often depends on environment variables. When an application is launched on a local account, some specific environment variables may have been defined. However when the application is launched by a Cameo server, it may not work, because some environment variables are missing. Indeed the environment is not the one of the local account even if the Cameo server is launched as a user service. The *environment files* are there to solve this problem.
|
|
|
|
|
|
An example with the *environment.properties* file:
|
|
|
```
|
|
|
MYAPP_HOME=/users/ics/home
|
|
|
LD_LIBRARY_PATH=/usr/local/lib
|
|
|
PATH=/users/ics/bin:$PATH
|
|
|
```
|
|
|
|
|
|
The variables are written using a standard *shell* syntax, and composition is possible. These variables are applied to the context of the launched process. So be careful with the special *PATH* variable: it cannot be the path of the executable. However if you need to execute a program inside your app, then this *PATH* will be used. Be also careful with *LD_LIBRARY_PATH* which is for security reason not inherited. It means that it is empty by default.
|
|
|
|
|
|
If your app has a graphical user interface, you may need to check the variable *DISPLAY* and add it to the environment file if necessary.
|
|
|
|
|
|
One practical way to check the required environment variables is to launch the app in a working environment e.g. on a local account and print the list of environment variables.
|
|
|
|
|
|
|
|
|
|