adef processes

run
environment variarbles
priority
core dump files
max file size
max memory lock
file descriptors
faultAction

Specify processes to run when the app is started. The processes section of the .adef has optional subsections.

Contains environment variables, limits, and handling actions that apply to all the processes listed. If different processes have different variables, they must be in a separate processes: sections.

processes:

    // Start up these processes when the app starts
    run: myProc1 ( myExe --foo -b 43 )
    run: myProc2 ( myExe –bar --b 92 )
    run: ( myExe2 "Hello, world." )  // If no proc name is specified, uses the exe name by default.

    // Env var settings (name = value) for all processes in this section.
    envVars:
        LE_LOG_LEVEL = DEBUG
        LE_LOG_LOCATION = "stderr + syslog"

    priority: medium    // Starting (and maximum) scheduling priority.  Process can only lower its priority from here.

    coreFileSize: 100K  // Maximum size of core dump files.
    maxFileSize: 50K    // Files are not allowed to grow bigger than this.
    memLockSize: 32K    // Maximum number of bytes allowed to be locked into physical memory using mlock().
    numFds: 20          // Maximum number of file descriptors allowed to be open at the same time.

processes:

    run: ( realTimeExe )

    priority: rt10

    /*-- Exception handling policy for processes in this section. --*/
    faultAction: restart   // Restart the process if it fails.
    watchdogAction: restart  // If the process doesn't kick its watchdog timer, kill it and restart it.

run

Names a process to be started by the Supervisor when the app is started. Also specifies executable and command-line arguments.

run: myProc1 ( myExe --foo -b 43 )

Process name and command-line arguments are optional

run: ( myexe ) 

Executables launched multiple times can appear in multiple “run” sections.

run: ( myexe )
run: ( myexe ) 

Command-line arguments passed to the process when started can appear after the executable name.

run: ( myexe --foo ) 
run: ( myexe --bar  // Note that the command-line can be broken into multiple lines for readability.
           --toto ) // And it can be commented too. 

Runtime process name is the same as the executable by default. If the process name should be different, add the process name before the executable name.

run: procA ( myexe2 --foo )
run: procB ( myexe2 --bar ) 

Executable names can be the ones listed in the app’s “executables:” section, listed in the “import:” section or the "files:" section, in Component.cdef “files:” section of an included component.

Quotation marks (either single ' or double ") can be used if white-space (spaces, tabs, //, /*, etc.) is needed inside a command-line argument, or if an empty argument is needed ("").

    run: ( greet "Hello world" )
    run: ( greet "Hello \"Mr. Smarty-pants\"" )
    run: ( greet 'Hello "Mr. Smarty-pants"' )
    run: ( fetchFromSmbShare "\\\\Server\\Share\\Directory\\file" )

environment variarbles

Environment variables appear as "name = value" pairs. The first value is the environment variable name; the second part is the variable value. Enclose the value in quotation marks (either single ' or double ") if white-space is required (spaces, tabs, //, /*, etc.).

    envVars:
        LE_LOG_LEVEL = DEBUG
        LE_LOG_LOCATION = "stderr + syslog"

priority

Specifies the starting (and maximum) scheduling priority. A running app process can only lower its priority from this point. Once it has lowered its priority, it can't raise it again. If the process starts at medium priority and reduces to low priority, it can't go back to medium priority. Default is medium.

Values:

  • idle - for very low priority processes that only get CPU time if no other processes waiting for the CPU.
  • low, medium, high - intended for normal processes that contend for the CPU. Processes with these priorities don't preempt each other, but their priorities affect how they're inserted into the schdeduling queue (high to low).
  • rt1 to rt32 - intended for (soft) realtime processes. A higher realtime priority will pre-empt a lower realtime priority (ie. "rt2" would pre-empt "rt1"). Processes with any realtime priority will pre-empt processes with high, medium, low and idle priorities. Processes with these realtime priorities pre-empt the Legato framework processes. Ensure design lets realtime processes relinquish the CPU appropriately.
priority: medium

core dump files

Specifies the maximum size of core dump files that can be created when processes crash. The K suffix permits specifying in kilobytes (multiples of 1024 bytes). Default is zero.

coreFileSize: 100K

max file size

Specifies the maximum size processes can make files. The K suffix permits specifying in kilobytes (multiples of 1024 bytes). Default is 88K.

maxFileSize: 50K

max memory lock

Specifies the maximum bytes of memory the process can lock into physical RAM (e.g., using mlock () ). Default is 8K.

memLockSize: 32K

file descriptors

Specifies the maximum number of file descriptors a process can have open at one time. Default is 256.

numFds: 20

faultAction

This subsection specifies the action that the Supervisor should take when the process terminates with a non-zero exit code or because of an un-caught signal (e.g., SIGSEGV, SIGBUS, SIGKILL). Default is ignore.

Possible values are:

  • "ignore" - the Supervisor just logs a warning message but will take no further action.
  • "restart" - log a critical message and then restart the process.
  • "restartApp" - log a critical message and then restart the entire application.
  • "terminateApp" - log a critical message then terminate the entire application (send all processes the SIGTERM signal, followed shortly by SIGKILL).
  • "reboot" - log an emergency message and reboot the system.
faultAction: restart



Copyright (C) Sierra Wireless, Inc. 2014. All rights reserved. Use of this work is subject to license.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines