= Changing CAE configuration == General The exact behaviour of CAE is controlled by a [wiki:Public/Docs/CAEConfigFile configuration file] named {{{CinnamonAsynchronousEngine.config.xml}}} that resides in the CAE program folder, typically, but not necessarily on the Cinnamon server. The configuration file is loaded when CAE is started. In the configuration file, all plugins that are used are referenced and configured. Each plugin reference in the configuration addresses a certain plugin class in one of the assemblies (.net / mono libraries). All assemblies that are referenced in the configuration must be present in the program folder, otherwise CAE will fail initializing the plugin. CAE and all standard plugins are compatible with .net and mono, and can run on Linux or Windows (and probably iOS - untested). > **NOTE:** Plugins other than the standard ones might be restricted to not run on all platforms, for example, because there is a dependency not available on one of the platforms. == Running CAE On the server running CAE, the configuration is typically such that CAE is started on system boot. This is also the default configuration when running CAE on the Cinnamon Server according to the [wiki:Public/Docs/CinnamonSetupDebian980#InstallingCinnamonAsynchronousEngineCAE installation instructions]. CAE is built in a way that it is very robust against crashing plugins. Typically, CAE will log the issue and continue. However, in some rare cases, or due to causes external to CAE, CAE may cease functioning. To make sure it remains available, the standard installation uses {{{supervise}}} contained in the {{{daemontools}}} package on Debian systems. {{{supervise}}} watches a process, in this case CAE, and restarts it when it stops. To run {{{supervise}}} to watch CAE, execute the following command: {{{ supervise /opt/cae/bin & }}} The ampersand ({{{&}}}) character at the end of the command line instructs Linux to run the command in the background. Even if CAE logs to the shell, you can close the session and CAE will continue running. == Reloading the configuration file Since the configuration file gets loaded on CAE start, reloading the file can be achieved by restarting CAE. This is also valid if CAE should be restarted after the executable or the libraries have changed. Since CAE is watched by {{{supervise}}} which restarts CAE if it stops, CAE can be restarted by stopping it - {{{supervise}}} will then restart it automatically. To find the CAE process, use the following command on a Linux server: {{{ ps aux | grep mono }}} This will return a result similar to the following: [[Image(pid.png)]] The value in the red box is the process id. Stop CAE with the following command, using the process id you retrieved: {{{ kill }}} Using the command {{{ ps aux | grep mono }}} again will show you whether {{{supervise}}} has successfully restarted CAE. == Stopping CAE You might want to stop CAE for one of the following reasons: * To start it by hand with active console logging and debug any unwanted behaviour CAE has shown in unattended mode. * To run CAE in the debugger on a development system. In both cases, you must stop the supervised CAE on the server to avoid interference with your second instance of the program. Stopping CAE works similarly as restarting CAE. Using the {{{kill}}} command on the CAE process stopped it and caused {{{supervise}}} to restart it. To stop CAE, therefore, first {{{supervise}}} must be stopped. Use the following commands to retrieve the process ids for {{{supervise}}} and CAE. Then use the following commands: {{{ ps aux | grep supervise kill ps aux | grep mono kill }}} == Running CAE with immediate log output To debug unwanted behaviour, it is useful to enable console logging and running CAE from the command line. * Stop {{{supervise}}} and CAE as described above. * Edit {{{/opt/cae/bin/CinnamonAsynchronousEngine.config.xml}}} with your preferred editor. * In the {{{log}}} element at the beginning of the file, make sure the attribute {{{enableconsole}}} is set to {{{true}}}. Save the file if you have changed it. * Execute the following command: {{{ /opt/cae/bin/cae.sh }}} > **NOTE:** To end CAE in this mode, press {{{Ctrl+c}}} > **ATTENTION:** Make sure to set the attribute {{{enableconsole}}} back to {{{false}}} after debugging. Many Linux system do not support console output by unattended applications and cause CAE to fail. If you need a log, switch {{{enablefile}}} is set to {{{true}}} and specify a writable log path. The default log path is {{{/opt/cae/log}}}.